content.mentions.forEach(function (mention) { if(ref.isBlob(mention.link)) { sbot.blobs.push(mention.link, function (err) { if(err) console.error(err) }) } })
getAvatar({links: api.sbot_links}, self_id, id, function (err, avatar) { if (err) return console.error(err) //don't show user has already selected an avatar. if(selected) return if(ref.isBlob(avatar.image)) img.src = api.blob_url(avatar.image) })
catchLinks(container, (href, external) => { if (external) { electron.shell.openExternal(href) } else if (ref.isBlob(href)) { electron.shell.openExternal(api.blob.sync.url(href)) } else if (ref.isMsg(href)) { getExternalHandler(href, (err, handler) => { if (err) throw err if (handler) { handler(href) } else { views.setView(href) } }) } else { views.setView(href) } })
toUrl: function (id) { if(ref.isBlob(id)) return api.blob_url(id) return '#'+(mentions[id]?mentions[id]:id) }
getAvatar({links: sbot_links}, me.id, author, function (err, avatar) { if (err) return console.error(err) if(ref.isBlob(avatar.image)) img.src = 'http://localhost:7777/'+encodeURIComponent(avatar.image) })
blobId: function (v) { if (!ref.isBlob(v)) return 'type' },
function resigil (hash) { return isBlob(hash) ? hash : '&'+hash }
function desigil (hash) { return isBlob(hash) ? hash.substring(1) : hash }
getAvatar({links: sbot_links}, id, author, function (err, avatar) { if (err) return console.error(err) if(ref.isBlob(avatar.image)) img.src = blob_url(avatar.image) })