git ssb

16+

Dominic / patchbay



Tree: 558b11e7e152891f436d17180335e54c3701aa6b

Files: 558b11e7e152891f436d17180335e54c3701aa6b / modules_basic / pub.js

542 bytesRaw
1var h = require('hyperscript')
2
3exports.needs = {
4 avatar_name: 'first',
5 avatar_link: 'first'
6}
7
8exports.gives = 'message_content'
9
10exports.create = function (api) {
11
12 return function (msg, sbot) {
13 var c = msg.value.content
14 if (c.type === 'pub') {
15 var address = c.address || {}
16 return [
17 h('p', 'announced an address for ',
18 api.avatar_link(address.key, api.avatar_name(address.key)), ':'),
19 h('blockquote',
20 h('code', address.host + ':' + address.port)
21 )
22 ]
23 }
24 }
25
26}
27

Built with git-ssb-web