Commit 5544d14b7f0ac44755ee8975c5e544c94aab285f
Show channel subscriptions
Anders Rune Jensen committed on 4/17/2017, 6:58:42 AMParent: a606674d3015f7f239614695ba937bc8d8bf6226
Files changed
index.js | changed |
index.js | ||
---|---|---|
@@ -200,11 +200,8 @@ | ||
200 | 200 … | return !msg.value || |
201 | 201 … | (msg.value.author in following || |
202 | 202 … | msg.value.content.channel in channelSubscriptions) |
203 | 203 … | }), |
204 | - pull.filter((msg) => { // channel subscription | |
205 | - return !msg.value.content.subscribed | |
206 | - }), | |
207 | 204 … | pull.collect(function (err, logs) { |
208 | 205 … | if (err) return respond(res, 500, err.stack || err) |
209 | 206 … | res.writeHead(200, { |
210 | 207 … | 'Content-Type': ctype("html") |
@@ -243,11 +240,8 @@ | ||
243 | 240 … | } |
244 | 241 … | |
245 | 242 … | pull( |
246 | 243 … | 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 | - }), | |
250 | 244 … | pull.collect(function (err, logs) { |
251 | 245 … | if (err) return respond(res, 500, err.stack || err) |
252 | 246 … | res.writeHead(200, { |
253 | 247 … | 'Content-Type': ctype("html") |
@@ -598,9 +592,9 @@ | ||
598 | 592 … | else if (c.type == 'contact' && c.following) { |
599 | 593 … | var name = c.contact |
600 | 594 … | if (typeof c.contactAbout != 'undefined') |
601 | 595 … | name = c.contactAbout.name |
602 | - return ' followed <a href="/user/' + c.contact + '">' + name + "</a>" | |
596 … | + return ' followed <a href="/' + c.contact + '">' + name + "</a>" | |
603 | 597 … | } |
604 | 598 … | else if (typeof c == 'string') |
605 | 599 … | return ' wrote something private ' |
606 | 600 … | else if (c.type == 'about') |
@@ -612,8 +606,10 @@ | ||
612 | 606 … | else if (c.type == 'ssb-dns') |
613 | 607 … | return ' updated dns' |
614 | 608 … | else if (c.type == 'pub') |
615 | 609 … | 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>" | |
616 | 612 … | else |
617 | 613 … | return renderDefault(c) |
618 | 614 … | } |
619 | 615 … |
Built with git-ssb-web