aboutsummaryrefslogtreecommitdiff
path: root/lib/app.js
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2019-10-27 21:53:27 -1000
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2019-11-08 14:46:09 -1000
commitafc11752be26c10ad7084d2555572e08c9cd7782 (patch)
treeba792e6196c8cdf5dceb75dfd7f32af2f301dd1e /lib/app.js
parentc7b1a484c3b62b17f138fe05b1c5df92ea8b0db0 (diff)
downloadpatchfoo-afc11752be26c10ad7084d2555572e08c9cd7782.tar.gz
patchfoo-afc11752be26c10ad7084d2555572e08c9cd7782.zip
Smarter rendering of link objects
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)
})
}