Files: 7b8459c024b593664fa22d32c9b9bcccfe02a2fa / 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