diff options
Diffstat (limited to 'lib/app.js')
-rw-r--r-- | lib/app.js | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -283,6 +283,24 @@ App.prototype.streamChannels = function (opts) { } App.prototype.streamMyChannels = function (id, opts) { + // use ssb-query plugin if it is available, since it has an index for + // author + type + if (this.sbot.query) return pull( + this.sbot.query.read({ + reverse: true, + query: [ + {$filter: { + value: { + author: id, + content: {type: 'channel', subscribed: true} + } + }}, + {$map: ['value', 'content', 'channel']} + ] + }), + pull.unique() + ) + return pull( this.sbot.createUserStream({id: id, reverse: true}), this.unboxMessages(), |