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