From c3809754bf089b801ee3ffa3341beb51a8005ca6 Mon Sep 17 00:00:00 2001 From: cel Date: Tue, 7 Mar 2017 10:50:15 -0500 Subject: Push attached blobs on publish --- lib/serve.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'lib/serve.js') 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) + }) } } -- cgit v1.2.3