git ssb

16+

Dominic / patchbay



Tree: 931ac024cad9b0e63311dd1a76de77d0490f8391

Files: 931ac024cad9b0e63311dd1a76de77d0490f8391 / modules_basic / about.js

785 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.avatar--fullsize', {src: blob_url(about.image)})
31 : null
32 )
33 )
34
35}
36
37
38
39
40
41

Built with git-ssb-web