git ssb

16+

Dominic / patchbay



Tree: e6ce2dce581a71e5f842aebd7db2ce276259e39e

Files: e6ce2dce581a71e5f842aebd7db2ce276259e39e / modules / about.js

768 bytesRaw
1
2var h = require('hyperscript')
3
4function idLink (id) {
5 return h('a', {href:'#'+id}, id)
6}
7
8function asLink (ln) {
9 return 'string' === typeof ln ? ln : ln.link
10}
11
12var blob_url = require('../plugs').first(exports.blob_url = [])
13
14exports.message_content = function (msg) {
15 if(msg.value.content.type !== 'about') return
16
17 if(!msg.value.content.image && !msg.value.content.name)
18 return
19
20 var about = msg.value.content
21 var id = msg.value.content.about
22 return h('p',
23 about.about === msg.value.author
24 ? h('span', 'self-identifies ')
25 : h('span', 'identifies ', idLink(id)),
26 ' as ',
27 h('a', {href:"#"+about.about},
28 about.name || null,
29 about.image
30 ? h('img', {src: blob_url(about.image)})
31 : null
32 )
33 )
34
35}
36
37
38
39
40
41

Built with git-ssb-web