git ssb

16+

cel / patchfoo



Commit 4267334f1d3b50038c43b2f41e1fb5da2e9dbd6c

Handle unsubscribed channels

Fix %TzZ1kq4UOAhq8mwXAkKl/OC8QEbCbWcRqYj9Jx2UsCU=.sha256
cel committed on 4/11/2018, 3:40:50 AM
Parent: 108ec779eeab8c092db727b660ddb752253b9192

Files changed

lib/app.jschanged
lib/app.jsView
@@ -473,29 +473,31 @@
473473 query: [
474474 {$filter: {
475475 value: {
476476 author: id,
477- content: {type: 'channel', subscribed: true}
477 + content: {type: 'channel'}
478478 }
479479 }},
480- {$map: ['value', 'content', 'channel']}
480 + {$map: ['value', 'content']}
481481 ]
482482 }),
483- pull.unique()
483 + pull.unique('channel'),
484 + pull.filter('subscribed'),
485 + pull.map('channel')
484486 )
485487
486488 return pull(
487489 this.sbot.createUserStream({id: id, reverse: true}),
488490 this.unboxMessages(),
489- pull.filter(function (msg) {
490- if (msg.value.content.type == 'channel') {
491- return msg.value.content.subscribed
492- }
493- }),
494491 pull.map(function (msg) {
495- return msg.value.content.channel
492 + return msg.value.content
496493 }),
497- pull.unique()
494 + pull.filter(function (c) {
495 + return c.type === 'channel'
496 + }),
497 + pull.unique('channel'),
498 + pull.filter('subscribed'),
499 + pull.map('channel')
498500 )
499501 }
500502
501503 function compareVoted(a, b) {

Built with git-ssb-web