git ssb

9+

cel / ssb-viewer



Commit 5544d14b7f0ac44755ee8975c5e544c94aab285f

Show channel subscriptions

Anders Rune Jensen committed on 4/17/2017, 6:58:42 AM
Parent: a606674d3015f7f239614695ba937bc8d8bf6226

Files changed

index.jschanged
index.jsView
@@ -200,11 +200,8 @@
200200 return !msg.value ||
201201 (msg.value.author in following ||
202202 msg.value.content.channel in channelSubscriptions)
203203 }),
204- pull.filter((msg) => { // channel subscription
205- return !msg.value.content.subscribed
206- }),
207204 pull.collect(function (err, logs) {
208205 if (err) return respond(res, 500, err.stack || err)
209206 res.writeHead(200, {
210207 'Content-Type': ctype("html")
@@ -243,11 +240,8 @@
243240 }
244241
245242 pull(
246243 sbot.query.read({ limit: 500, reverse: true, query: [{$filter: { value: { content: { channel: channelId }}}}]}),
247- pull.filter((msg) => { // channel subscription
248- return !msg.value.content.subscribed
249- }),
250244 pull.collect(function (err, logs) {
251245 if (err) return respond(res, 500, err.stack || err)
252246 res.writeHead(200, {
253247 'Content-Type': ctype("html")
@@ -598,9 +592,9 @@
598592 else if (c.type == 'contact' && c.following) {
599593 var name = c.contact
600594 if (typeof c.contactAbout != 'undefined')
601595 name = c.contactAbout.name
602- return ' followed <a href="/user/' + c.contact + '">' + name + "</a>"
596 + return ' followed <a href="/' + c.contact + '">' + name + "</a>"
603597 }
604598 else if (typeof c == 'string')
605599 return ' wrote something private '
606600 else if (c.type == 'about')
@@ -612,8 +606,10 @@
612606 else if (c.type == 'ssb-dns')
613607 return ' updated dns'
614608 else if (c.type == 'pub')
615609 return ' connected to a pub'
610 + else if (c.type == 'channel' && c.subscribed)
611 + return ' subscribed to channel <a href="/channel/' + c.channel + '">#' + c.channel + "</a>"
616612 else
617613 return renderDefault(c)
618614 }
619615

Built with git-ssb-web