Commit 3f14f6b6ebe8ee63641a6ffe734fbb1689543aa4
filter out likes from bumping channel and all
Matt McKegg committed on 10/18/2017, 11:13:29 AMParent: 90e95e88c9ba1764127661b72a41b571f87c3b54
Files changed
modules/page/html/render/all.js | changed |
modules/page/html/render/channel.js | changed |
modules/page/html/render/all.js | ||
---|---|---|
@@ -31,9 +31,13 @@ | ||
31 | 31 | ] |
32 | 32 | |
33 | 33 | var feedView = api.feed.html.rollup(api.feed.pull.public, { |
34 | 34 | bumpFilter: (msg) => { |
35 | - return msg.value.content && typeof msg.value.content === 'object' | |
35 | + if (msg.value.content) { | |
36 | + // filter out likes | |
37 | + if (msg.value.content.type === 'vote') return false | |
38 | + return msg.value.content && typeof msg.value.content === 'object' | |
39 | + } | |
36 | 40 | }, |
37 | 41 | prepend |
38 | 42 | }) |
39 | 43 |
modules/page/html/render/channel.js | ||
---|---|---|
@@ -51,8 +51,10 @@ | ||
51 | 51 | bumpFilter: mentionFilter |
52 | 52 | }) |
53 | 53 | |
54 | 54 | function mentionFilter (msg) { |
55 | + // filter out likes | |
56 | + if (msg.value.content.type === 'vote') return false | |
55 | 57 | if (msg.value.content.channel === channel) return true |
56 | 58 | if (Array.isArray(msg.value.content.mentions)) { |
57 | 59 | if (msg.value.content.mentions.some(mention => { |
58 | 60 | return mention && mention.link === `#${channel}` |
Built with git-ssb-web