git ssb

16+

Dominic / patchbay



Tree: cb94bd0d83fae7b007a0e33061df18c620bd6cb1

Files: cb94bd0d83fae7b007a0e33061df18c620bd6cb1 / modules / avatar-image.js

453 bytesRaw
1
2var getAvatar = require('ssb-avatar')
3var h = require('hyperscript')
4var ref = require('ssb-ref')
5
6exports.avatar_image = function (author, sbot) {
7 var img = h('img', {src: 'http://localhost:7777/img/fallback.png'})
8 sbot.whoami(function (err, me) {
9 getAvatar(sbot, me.id, author, function (err, avatar) {
10 if(ref.isBlob(avatar.image))
11 img.src = 'http://localhost:7777/'+encodeURIComponent(avatar.image)
12 })
13 })
14 return img
15}
16
17

Built with git-ssb-web