From 5544d14b7f0ac44755ee8975c5e544c94aab285f Mon Sep 17 00:00:00 2001 From: Anders Rune Jensen Date: Mon, 17 Apr 2017 08:58:42 +0200 Subject: [PATCH] Show channel subscriptions --- index.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/index.js b/index.js index a689fa4..c2d8e99 100644 --- a/index.js +++ b/index.js @@ -201,9 +201,6 @@ exports.init = function (sbot, config) { (msg.value.author in following || msg.value.content.channel in channelSubscriptions) }), - pull.filter((msg) => { // channel subscription - return !msg.value.content.subscribed - }), pull.collect(function (err, logs) { if (err) return respond(res, 500, err.stack || err) res.writeHead(200, { @@ -244,9 +241,6 @@ exports.init = function (sbot, config) { pull( sbot.query.read({ limit: 500, reverse: true, query: [{$filter: { value: { content: { channel: channelId }}}}]}), - pull.filter((msg) => { // channel subscription - return !msg.value.content.subscribed - }), pull.collect(function (err, logs) { if (err) return respond(res, 500, err.stack || err) res.writeHead(200, { @@ -599,7 +593,7 @@ function render(opts, c) var name = c.contact if (typeof c.contactAbout != 'undefined') name = c.contactAbout.name - return ' followed ' + name + "" + return ' followed ' + name + "" } else if (typeof c == 'string') return ' wrote something private ' @@ -613,6 +607,8 @@ function render(opts, c) return ' updated dns' else if (c.type == 'pub') return ' connected to a pub' + else if (c.type == 'channel' && c.subscribed) + return ' subscribed to channel #' + c.channel + "" else return renderDefault(c) }