diff options
author | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2018-04-10 17:40:50 -1000 |
---|---|---|
committer | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2018-04-10 17:40:50 -1000 |
commit | 4267334f1d3b50038c43b2f41e1fb5da2e9dbd6c (patch) | |
tree | 4645f19cccd3af4a4edfa0ec99a4702bf5d6b8fd | |
parent | 108ec779eeab8c092db727b660ddb752253b9192 (diff) | |
download | patchfoo-4267334f1d3b50038c43b2f41e1fb5da2e9dbd6c.tar.gz patchfoo-4267334f1d3b50038c43b2f41e1fb5da2e9dbd6c.zip |
Handle unsubscribed channels
Fix %TzZ1kq4UOAhq8mwXAkKl/OC8QEbCbWcRqYj9Jx2UsCU=.sha256
-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') ) } |