Files: 86a733778b0428dc270a65273d76c6bb187dad06 / modules / avatar-image.js
453 bytesRaw
1 | |
2 | var getAvatar = require('ssb-avatar') |
3 | var h = require('hyperscript') |
4 | var ref = require('ssb-ref') |
5 | |
6 | exports.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