Files: d6861e3a6c97728f151fbc42d87fe7b565358976 / bookmark / async / description.js
557 bytesRaw
1 | const nest = require('depnest') |
2 | |
3 | exports.gives = nest('bookmark.async.description') |
4 | |
5 | exports.needs = nest({ |
6 | 'sbot.async.publish': 'first', |
7 | 'keys.sync.id': 'first' |
8 | }) |
9 | |
10 | exports.create = function(api) { |
11 | return nest('bookmark.async.description', function({ description, bookmark, public }, cb) { |
12 | if (public) { |
13 | api.sbot.async.publish({ type: 'about', about: bookmark, description }, cb) |
14 | } else { |
15 | const id = api.keys.sync.id() |
16 | api.sbot.async.publish({ type: 'about', about: bookmark, description, recps: [ id ] }, cb) |
17 | } |
18 | }) |
19 | } |
20 |
Built with git-ssb-web