Files: ae7c2d638a47d2b374cec6c88e45d20c4290fe33 / modules / message-link.js
340 bytesRaw
1 | var h = require('hyperscript') |
2 | |
3 | exports.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