aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2018-04-10 17:40:50 -1000
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2018-04-10 17:40:50 -1000
commit4267334f1d3b50038c43b2f41e1fb5da2e9dbd6c (patch)
tree4645f19cccd3af4a4edfa0ec99a4702bf5d6b8fd /lib
parent108ec779eeab8c092db727b660ddb752253b9192 (diff)
downloadpatchfoo-4267334f1d3b50038c43b2f41e1fb5da2e9dbd6c.tar.gz
patchfoo-4267334f1d3b50038c43b2f41e1fb5da2e9dbd6c.zip
Handle unsubscribed channels
Fix %TzZ1kq4UOAhq8mwXAkKl/OC8QEbCbWcRqYj9Jx2UsCU=.sha256
Diffstat (limited to 'lib')
-rw-r--r--lib/app.js22
1 files changed, 12 insertions, 10 deletions
diff --git a/lib/app.js b/lib/app.js
index 9f0b883..cbbc74e 100644
--- a/lib/app.js
+++ b/lib/app.js
@@ -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')
)
}