Files: e26da8bb43ee4322240170dc15fa3b89df6ee0fa / feed / pull / public.js
531 bytesRaw
1 | const nest = require('depnest') |
2 | var pull = require('pull-stream') |
3 | |
4 | exports.gives = nest('feed.pull.public') |
5 | exports.needs = nest({ |
6 | 'sbot.pull.feed': 'first', |
7 | 'message.sync.isBlocked': 'first' |
8 | }) |
9 | |
10 | exports.create = function (api) { |
11 | return nest('feed.pull.public', (opts) => { |
12 | // handle last item passed in as lt |
13 | opts.lt = (opts.lt && opts.lt.value) |
14 | ? opts.lt.value.timestamp |
15 | : opts.lt |
16 | |
17 | return pull( |
18 | api.sbot.pull.feed(opts), |
19 | pull.filter(msg => !api.message.sync.isBlocked(msg)) |
20 | ) |
21 | }) |
22 | } |
23 |
Built with git-ssb-web