git ssb

16+

Dominic / patchbay



Tree: 1e399015dfde5516551cee94619965e25c5fc446

Files: 1e399015dfde5516551cee94619965e25c5fc446 / modules / message-name.js

595 bytesRaw
1
2var sbot_get = require('../plugs').first(exports.sbot_get = [])
3
4exports.message_name = function (id, cb) {
5 sbot_get(id, function (err, value) {
6 if(err && err.name == 'NotFoundError')
7 return cb(null, id.substring(0, 10)+'...(missing)')
8 if(value.content.type === 'post' && 'string' === typeof value.content.text)
9 return cb(null, value.content.text.substring(0, 40)+'...')
10 else if('string' === typeof value.content.text)
11 return cb(null, value.content.type + ':'+value.content.text.substring(0, 20))
12 else
13 return cb(null, id.substring(0, 10)+'...')
14 })
15}
16

Built with git-ssb-web