git ssb

16+

Dominic / patchbay



Tree: 96d0a60a7b7c41087f0c52c4ed0292f86ba7d4b1

Files: 96d0a60a7b7c41087f0c52c4ed0292f86ba7d4b1 / modules / message-link.js

412 bytesRaw
1var h = require('hyperscript')
2
3exports.message_link = function (el, id, sbot) {
4 console.log('MESSAGE_LINK', el, id)
5 if(el) return el
6
7 var link = h('a', {href: '#'+id}, id.substring(0, 10)+'...')
8
9 sbot.get(id, function (err, value) {
10 if(err) return
11 console.log('LINKED', value)
12 if(value.content.text)
13 link.textContent = value.content.text.substring(0, 40)+'...'
14 })
15
16 return link
17}
18
19
20

Built with git-ssb-web