diff options
author | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2017-10-13 13:18:56 -1000 |
---|---|---|
committer | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2017-10-13 13:18:56 -1000 |
commit | 5119a5de3b2bba836f2847ca18227c14baf2b629 (patch) | |
tree | a0d92d2a17c27bd0cb7ca372718d44852547c1cf /lib/render-msg.js | |
parent | 7afbbc3ef5ed319fedcc079b860705ff63fa862d (diff) | |
download | patchfoo-5119a5de3b2bba836f2847ca18227c14baf2b629.tar.gz patchfoo-5119a5de3b2bba836f2847ca18227c14baf2b629.zip |
Filter messages socially
Diffstat (limited to 'lib/render-msg.js')
-rw-r--r-- | lib/render-msg.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/render-msg.js b/lib/render-msg.js index 8ba45eb..2d52c83 100644 --- a/lib/render-msg.js +++ b/lib/render-msg.js @@ -352,6 +352,15 @@ function title(str) { RenderMsg.prototype.title = function (cb) { var self = this + self.app.filterMsg(self.msg, self.opts, function (err, show) { + if (err) return cb(err) + if (show) self.title1(cb) + else cb(null, '[…]') + }) +} + +RenderMsg.prototype.title1 = function (cb) { + var self = this if (!self.c || typeof self.c !== 'object') { cb(null, self.msg.key) } else if (typeof self.c.text === 'string') { |