Files: c18b233c6d62741496978cd8dc1f34a093946f8b / feed / pull / private.js
622 bytesRaw
1 | const pull = require('pull-stream') |
2 | const nest = require('depnest') |
3 | |
4 | exports.gives = nest('feed.pull.private') |
5 | exports.needs = nest({ |
6 | 'sbot.log': 'first', |
7 | // 'message.sync.unbox': 'first' |
8 | }) |
9 | exports.create = function (api) { |
10 | return nest('feed.pull.private': function (opts) { |
11 | pull( |
12 | api.sbot_log(opts)//, |
13 | // unbox() |
14 | ) |
15 | } |
16 | |
17 | // scoped |
18 | |
19 | function unbox () { |
20 | return pull( |
21 | pull.filter(function (msg) { |
22 | return typeof msg.value.content === 'string' |
23 | }), |
24 | pull.map(function (msg) { |
25 | return api.message.sync.unbox(msg) |
26 | }), |
27 | pull.filter(Boolean) |
28 | ) |
29 | } |
30 | } |
31 |
Built with git-ssb-web