git ssb

16+

Dominic / patchbay



Tree: 9334dd2b798b099cd5e9bd7e007f444359f466bb

Files: 9334dd2b798b099cd5e9bd7e007f444359f466bb / 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