diff options
Diffstat (limited to 'lib/serve.js')
-rw-r--r-- | lib/serve.js | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/serve.js b/lib/serve.js index f825ed7..c51a331 100644 --- a/lib/serve.js +++ b/lib/serve.js @@ -3627,8 +3627,16 @@ Serve.prototype.getBuiltinEmojiLink = function (name) { } Serve.prototype.getMsgDecryptedMaybeOoo = function (key, cb) { - if (this.useOoo) this.app.getMsgDecryptedOoo(key, cb) - else this.app.getMsgDecrypted(key, cb) + var self = this + if (this.useOoo) this.app.getMsgDecryptedOoo(key, next) + else this.app.getMsgDecrypted(key, next) + function next(err, msg) { + if (err) return cb(err) + var c = msg && msg.value && msg.value.content + if (typeof c === 'string' && self.query.unbox) + self.app.unboxMsgWithKey(msg, String(self.query.unbox).replace(/ /g, '+'), cb) + else cb(null, msg) + } } Serve.prototype.emojis = function (path) { |