git ssb

10+

Matt McKegg / patchwork



Commit f1ffefef120bd92dc224753582b37184ead261cd

channel: fix missing tagged with channel posts

Matt McKegg committed on 12/13/2017, 7:43:47 AM
Parent: 3c9974aebea46a6e072284cfdd3ef4d581f054ee

Files changed

modules/page/html/render/channel.jschanged
modules/page/html/render/channel.jsView
@@ -57,14 +57,20 @@
5757 if (msg.value.content.type === 'vote') return false
5858 if (api.channel.sync.normalize(msg.value.content.channel) === channel) return true
5959 if (Array.isArray(msg.value.content.mentions)) {
6060 if (msg.value.content.mentions.some(mention => {
61- return mention && api.channel.sync.normalize(mention.link) === `#${channel}`
61 + return mention && getNormalized(mention.link) === `#${channel}`
6262 })) {
6363 return 'channel-mention'
6464 }
6565 }
6666 }
67 +
68 + function getNormalized (link) {
69 + if (typeof link === 'string' && link.startsWith('#')) {
70 + return `#${api.channel.sync.normalize(link.slice(1))}`
71 + }
72 + }
6773 })
6874
6975 function subscribe (id) {
7076 // confirm

Built with git-ssb-web