aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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')
)
}