git ssb

0+

ev / microbay



forked from Dominic / patchbay

Tree: 8ec3c173cbb66e5cd3c3866431ffd5883c151db2

Files: 8ec3c173cbb66e5cd3c3866431ffd5883c151db2 / modules / about.js

675 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