Files: 7c22ec2ce201b04fa7c787e4f7833eb28065327b / modules_basic / pub.js
542 bytesRaw
1 | var h = require('hyperscript') |
2 | |
3 | exports.needs = { |
4 | avatar_name: 'first', |
5 | avatar_link: 'first' |
6 | } |
7 | |
8 | exports.gives = 'message_content' |
9 | |
10 | exports.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