git ssb

16+

Dominic / patchbay



The existing avatar fallback relies on a blob I don't have.

%ZCz/WJXHvBB/2QkGiPAO8fJ+nL0G26IfHvoIdGl4TLg=.sha256
Closed mixmix wants to merge commits into master from mixmix / patchbay-mix / reliable_avatar_fallback
modules/avatar-image.jschanged
modules/avatar_fallback.pngadded
modules/avatar-image.jsView
@@ -1,8 +1,9 @@
11
22 var getAvatar = require('ssb-avatar')
33 var h = require('hyperscript')
44 var ref = require('ssb-ref')
5 +var path = require('path')
56
67 var plugs = require('../plugs')
78 var sbot_query = plugs.first(exports.sbot_query = [])
89 var blob_url = require('../plugs').first(exports.blob_url = [])
@@ -10,9 +11,9 @@
1011 var pull = require('pull-stream')
1112
1213 var id = require('../keys').id
1314
14-var default_avatar = '&qjeAs8+uMXLlyovT4JnEpMwTNDx/QXHfOl2nv2u0VCM=.sha256'
15 +var default_avatar = path.join(__dirname, 'avatar_fallback.png')
1516
1617 var avatars = AVATARS = {}
1718
1819 function isFunction (f) {
@@ -77,9 +78,9 @@
7778 exports.avatar_image = function (author, classes) {
7879 classes = classes || ''
7980 if(classes && 'string' === typeof classes) classes = '.avatar--'+classes
8081
81- var img = h('img'+classes, {src: blob_url(default_avatar)})
82 + var img = h('img'+classes, {src: default_avatar})
8283 // getAvatar({links: sbot_links}, id, author, function (err, avatar) {
8384 // if (err) return console.error(err)
8485 // if(ref.isBlob(avatar.image))
8586 // img.src = blob_url(avatar.image)
modules/avatar_fallback.png
modules/avatar_fallback.png

Built with git-ssb-web