From afc11752be26c10ad7084d2555572e08c9cd7782 Mon Sep 17 00:00:00 2001 From: cel Date: Sun, 27 Oct 2019 21:53:27 -1000 Subject: Smarter rendering of link objects --- lib/app.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'lib/app.js') 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) }) } -- cgit v1.2.3