Files: 73d53a413c5991111416c31c1d615c89aefe88af / tag / async / apply.js
658 bytesRaw
1 | const nest = require('depnest') |
2 | |
3 | exports.gives = nest('tag.async.apply') |
4 | |
5 | exports.needs = nest({ |
6 | 'sbot.async.publish': 'first' |
7 | }) |
8 | |
9 | exports.create = function(api) { |
10 | return nest('tag.async.apply', function(data, cb) { |
11 | const { tagged, message, recps, tag } = data |
12 | if (recps && recps.length === 0) { |
13 | api.sbot.async.publish({ |
14 | type: 'tag', |
15 | tagged, |
16 | message, |
17 | root: tag, |
18 | branch: tag, |
19 | recps: data.recps, |
20 | private: true |
21 | }, cb) |
22 | } else { |
23 | api.sbot.async.publish({ |
24 | type: 'tag', |
25 | tagged, |
26 | message, |
27 | root: tag, |
28 | branch: tag |
29 | }, cb) |
30 | } |
31 | }) |
32 | } |
33 |
Built with git-ssb-web