diff options
Diffstat (limited to 'lib/app.js')
-rw-r--r-- | lib/app.js | 22 |
1 files changed, 12 insertions, 10 deletions
@@ -474,27 +474,29 @@ App.prototype.streamMyChannels = function (id, opts) { {$filter: { value: { author: id, - content: {type: 'channel', subscribed: true} + content: {type: 'channel'} } }}, - {$map: ['value', 'content', 'channel']} + {$map: ['value', 'content']} ] }), - pull.unique() + pull.unique('channel'), + pull.filter('subscribed'), + pull.map('channel') ) return pull( this.sbot.createUserStream({id: id, reverse: true}), this.unboxMessages(), - pull.filter(function (msg) { - if (msg.value.content.type == 'channel') { - return msg.value.content.subscribed - } - }), pull.map(function (msg) { - return msg.value.content.channel + return msg.value.content }), - pull.unique() + pull.filter(function (c) { + return c.type === 'channel' + }), + pull.unique('channel'), + pull.filter('subscribed'), + pull.map('channel') ) } |