git ssb

16+

Dominic / patchbay



Tree: 08e1fc42a3722f8f133fdcb3a7460462d599f889

Files: 08e1fc42a3722f8f133fdcb3a7460462d599f889 / 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