git ssb

16+

Dominic / patchbay



Tree: 33dbf75c73b0fb716af94766e08f4dd2fd3443d5

Files: 33dbf75c73b0fb716af94766e08f4dd2fd3443d5 / 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