Files: 418ac35b065b1ea7acf2d01ec7f1de61a5a721df / feed / pull / public.js
532 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