diff options
-rw-r--r-- | lib/app.js | 4 | ||||
-rw-r--r-- | lib/serve.js | 10 |
2 files changed, 13 insertions, 1 deletions
@@ -109,6 +109,10 @@ App.prototype.addBlob = function (cb) { ) } +App.prototype.pushBlob = function (id, cb) { + this.sbot.blobs.push(id, cb) +} + function getMsgWithValue(sbot, id, cb) { sbot.get(id, function (err, value) { if (err) return cb(err) diff --git a/lib/serve.js b/lib/serve.js index 7cda95d..88fe389 100644 --- a/lib/serve.js +++ b/lib/serve.js @@ -946,7 +946,15 @@ Serve.prototype.composer = function (opts, cb) { } catch(e) { return cb(), u.renderError(e) } - return self.app.render.publish(content, cb) + var done = multicb({pluck: 1, spread: true}) + toArray(content && content.mentions).forEach(function (mention) { + if (mention.link && mention.link[0] === '&' && !isNaN(mention.size)) + self.app.pushBlob(mention.link, done()) + }) + done(function (err) { + if (err) return cb(err) + self.app.render.publish(content, cb) + }) } } |