git ssb

16+

Dominic / patchbay



Tree: 586029e96f32a0cff461ec17d522d4877ec63fc0

Files: 586029e96f32a0cff461ec17d522d4877ec63fc0 / modules_basic / 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