git ssb

16+

Dominic / patchbay



Tree: 86a733778b0428dc270a65273d76c6bb187dad06

Files: 86a733778b0428dc270a65273d76c6bb187dad06 / modules / message-link.js

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

Built with git-ssb-web