Exemplo n.º 1
0
 content.mentions.forEach(function (mention) {
   if(ref.isBlob(mention.link)) {
     sbot.blobs.push(mention.link, function (err) {
       if(err) console.error(err)
     })
   }
 })
Exemplo n.º 2
0
 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)
 })
Exemplo n.º 3
0
 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)
   }
 })
Exemplo n.º 4
0
 toUrl: function (id) {
   if(ref.isBlob(id)) return api.blob_url(id)
   return '#'+(mentions[id]?mentions[id]:id)
 }
Exemplo n.º 5
0
 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)
 })
Exemplo n.º 6
0
 blobId: function (v) {
   if (!ref.isBlob(v))
     return 'type'
 },
Exemplo n.º 7
0
function resigil (hash) {
  return isBlob(hash) ? hash : '&'+hash
}
Exemplo n.º 8
0
function desigil (hash) {
  return isBlob(hash) ? hash.substring(1) : hash
}
Exemplo n.º 9
0
 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)
 })