Files: a68bd612e7949b0587d7769bceabed26024ed03f / modules / about.js
675 bytesRaw
1 | |
2 | var h = require('hyperscript') |
3 | |
4 | function idLink (id) { |
5 | return h('a', {href:'#'+id}, id) |
6 | } |
7 | |
8 | exports.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