Commit 6513733df7f7dc3466f8504069f1c20414ee1cdf
profile: filter out boxed messages
Matt McKegg committed on 6/20/2017, 4:07:59 PMParent: e031c60a5b1665b894adc39a070671847799cc52
Files changed
feed/pull/profile.js | changed |
feed/pull/profile.js | |||
---|---|---|---|
@@ -1,6 +1,7 @@ | |||
1 | 1 … | const nest = require('depnest') | |
2 | 2 … | const extend = require('xtend') | |
3 … | +const pull = require('pull-stream') | ||
3 | 4 … | ||
4 | 5 … | exports.gives = nest('feed.pull.profile') | |
5 | 6 … | exports.needs = nest('sbot.pull.userFeed', 'first') | |
6 | 7 … | exports.create = function (api) { | |
@@ -9,8 +10,13 @@ | |||
9 | 10 … | return function (opts) { | |
10 | 11 … | opts = extend(opts, { | |
11 | 12 … | id, lt: (opts.lt && typeof opts.lt === 'object') ? opts.lt.value.sequence : opts.lt | |
12 | 13 … | }) | |
13 | - return api.sbot.pull.userFeed(opts) | ||
14 … | + return pull( | ||
15 … | + api.sbot.pull.userFeed(opts), | ||
16 … | + pull.filter(msg => { | ||
17 … | + return typeof msg.value.content !== 'string' | ||
18 … | + }) | ||
19 … | + ) | ||
14 | 20 … | } | |
15 | 21 … | }) | |
16 | 22 … | } |
Built with git-ssb-web