Files: d20fb6972ed016e0dfeadef9da886fa2caa08a41 / modules_basic / message-name.js
595 bytesRaw
1 | |
2 | var sbot_get = require('../plugs').first(exports.sbot_get = []) |
3 | |
4 | exports.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