git ssb

0+

Josiah / patchbay-tags



Tree: d6861e3a6c97728f151fbc42d87fe7b565358976

Files: d6861e3a6c97728f151fbc42d87fe7b565358976 / bookmark / async / messageId.js

547 bytesRaw
1const nest = require('depnest')
2
3exports.gives = nest('bookmark.async.messageId')
4
5exports.needs = nest({
6 'sbot.async.publish': 'first',
7 'keys.sync.id': 'first'
8})
9
10exports.create = function(api) {
11 return nest('bookmark.async.messageId', function({ messageId, bookmark, public }, cb) {
12 if (public) {
13 api.sbot.async.publish({ type: 'about', about: bookmark, messageId }, cb)
14 } else {
15 const id = api.keys.sync.id()
16 api.sbot.async.publish({ type: 'about', about: bookmark, messageId, recps: [ id ] }, cb)
17 }
18 })
19}
20

Built with git-ssb-web