aboutsummaryrefslogtreecommitdiff
path: root/lib/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/app.js')
-rw-r--r--lib/app.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/app.js b/lib/app.js
index c65552e..4119179 100644
--- a/lib/app.js
+++ b/lib/app.js
@@ -486,10 +486,17 @@ function sbotGet(sbot, id, cb) {
}
function getMsgWithValue(sbot, id, cb) {
+ var self = this
if (!id) return cb()
+ var parts = id.split('?unbox=')
+ id = parts[0]
+ var unbox = parts[1] && parts[1].replace(/ /g, '+')
sbotGet(sbot, id, function (err, value) {
if (err) return cb(err)
- cb(null, {key: id, value: value})
+ var msg = {key: id, value: value}
+ if (unbox && value && typeof value.content === 'string')
+ return self.app.unboxMsgWithKey(msg, unbox, cb)
+ cb(null, msg)
})
}