git ssb

10+

Matt McKegg / patchwork



Commit 5e1dee9efadcb271428bb49a23bbcb19041dd2be

don't render about messages with non-blob images

Matt McKegg committed on 5/18/2018, 5:52:36 AM
Parent: 2fca45e4496fc0ac936fb38aa08eadd7aa9de703

Files changed

plugs/message/html/render/about.jschanged
plugs/message/html/render/about.jsView
@@ -89,8 +89,18 @@
8989 function isRenderable (msg) {
9090 if (msg.value.content.type !== 'about') return
9191 if (!ref.isFeed(msg.value.content.about)) return
9292 var c = msg.value.content
93- if (!c || (!c.description && !c.image && !c.name)) return
93 + if (!c || (!c.description && !isBlobLink(c.image) && !c.name)) return
9494 return true
9595 }
9696 }
97 +
98 +function isBlobLink (link) {
99 + if (link && typeof link.link === 'string') {
100 + link = link.link
101 + }
102 + var parsed = ref.parseLink(link)
103 + if (parsed && ref.isBlob(parsed.link)) {
104 + return true
105 + }
106 +}

Built with git-ssb-web