git ssb

16+

Dominic / patchbay



Tree: ae12a05c8bad934d6e90d7b524a9a16e76ed5b98

Files: ae12a05c8bad934d6e90d7b524a9a16e76ed5b98 / modules / about.js

676 bytesRaw
1
2var h = require('hyperscript')
3
4function idLink (id) {
5 return h('a', {href:'#/'+id}, id)
6}
7
8exports.message_content = function (msg, sbot) {
9 if(msg.value.content.type !== 'about') return
10
11 if(!msg.value.content.image && !msg.value.content.name)
12 return
13
14 var about = msg.value.content
15 var id = msg.value.content.about
16 return h('p',
17 about.about === msg.value.author
18 ? h('span', 'self-identifies')
19 : h('span', 'identifies', idLink(id)),
20 ' as ',
21 h('a', {href:"#/"+about.about},
22 about.name || null,
23 about.image
24 ? h('img', {src:'http://localhost:7777/'+ encodeURIComponent(about.image.link)})
25 : null
26 )
27 )
28
29}
30
31
32
33
34

Built with git-ssb-web