Something went wrong. Try again.
secure-scuttlebot classic
Something went wrong. Try again.
929 B · 46 lines
JavaScript
at main
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
var h = require('hyperscript')
function idLink (id) { return h('a', {href:'#'+id}, id)}
function asLink (ln) { return 'string' === typeof ln ? ln : ln.link}
//var blob_url = require('../plugs').first(exports.blob_url = [])
exports.needs = { blob_url: 'first'}
exports.gives = 'message_content'
exports.create = function (api) {
return function (msg) { if(msg.value.content.type !== 'about') return
if(!msg.value.content.image && !msg.value.content.name) return
var about = msg.value.content var id = msg.value.content.about return h('p', about.about === msg.value.author ? h('span', 'self-identifies ') : h('span', 'identifies ', idLink(id)), ' as ', h('a', {href:"#"+about.about}, about.name || null, about.image ? h('img.avatar--thumbnail', {src: api.blob_url(asLink(about.image))}) : null ) )
}
}