git ssb

0+

alanz / patchwork



forked from Matt McKegg / patchwork

Commit 3f14f6b6ebe8ee63641a6ffe734fbb1689543aa4

filter out likes from bumping channel and all

Matt McKegg committed on 10/18/2017, 11:13:29 AM
Parent: 90e95e88c9ba1764127661b72a41b571f87c3b54

Files changed

modules/page/html/render/all.jschanged
modules/page/html/render/channel.jschanged
modules/page/html/render/all.jsView
@@ -31,9 +31,13 @@
3131 ]
3232
3333 var feedView = api.feed.html.rollup(api.feed.pull.public, {
3434 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+ }
3640 },
3741 prepend
3842 })
3943
modules/page/html/render/channel.jsView
@@ -51,8 +51,10 @@
5151 bumpFilter: mentionFilter
5252 })
5353
5454 function mentionFilter (msg) {
55+ // filter out likes
56+ if (msg.value.content.type === 'vote') return false
5557 if (msg.value.content.channel === channel) return true
5658 if (Array.isArray(msg.value.content.mentions)) {
5759 if (msg.value.content.mentions.some(mention => {
5860 return mention && mention.link === `#${channel}`

Built with git-ssb-web