Commit 5e1dee9efadcb271428bb49a23bbcb19041dd2be
don't render about messages with non-blob images
Matt McKegg committed on 5/18/2018, 5:52:36 AMParent: 2fca45e4496fc0ac936fb38aa08eadd7aa9de703
Files changed
plugs/message/html/render/about.js | changed |
plugs/message/html/render/about.js | |||
---|---|---|---|
@@ -89,8 +89,18 @@ | |||
89 | 89 … | function isRenderable (msg) { | |
90 | 90 … | if (msg.value.content.type !== 'about') return | |
91 | 91 … | if (!ref.isFeed(msg.value.content.about)) return | |
92 | 92 … | 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 | ||
94 | 94 … | return true | |
95 | 95 … | } | |
96 | 96 … | } | |
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