diff options
author | _ssb <_ssb@trouble.kagu-tsuchi.com> | 2017-05-10 22:06:25 -0500 |
---|---|---|
committer | _ssb <_ssb@trouble.kagu-tsuchi.com> | 2017-05-11 19:14:32 -0500 |
commit | 1e1d32ef170391da41c2c064fc9a557a1ba667d1 (patch) | |
tree | 9e4a925c89aafe2bb3fbcf5f3d704967bddf9b9e /lib/app.js | |
parent | 29f56c3e49c767f75164f57ccd1ac52b389794c0 (diff) | |
download | patchfoo-1e1d32ef170391da41c2c064fc9a557a1ba667d1.tar.gz patchfoo-1e1d32ef170391da41c2c064fc9a557a1ba667d1.zip |
First pass at listing subscribed channels
Diffstat (limited to 'lib/app.js')
-rw-r--r-- | lib/app.js | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -282,6 +282,22 @@ App.prototype.streamChannels = function (opts) { ) } +App.prototype.streamMyChannels = function (id, opts) { + 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 + }), + pull.unique() + ) +} + App.prototype.createContactStreams = function (id) { return new Contacts(this.sbot).createContactStreams(id) } |