git ssb

16+

Dominic / patchbay



Tree: 9cbca35a9f214a2cc57f38645bc16fb874eb8222

Files: 9cbca35a9f214a2cc57f38645bc16fb874eb8222 / modules_basic / pub.js

694 bytesRaw
1var 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//
6exports.needs = {
7 avatar_name: 'first',
8 avatar_link: 'first'
9}
10
11exports.gives = 'message_content'
12
13exports.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