aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/app.js4
-rw-r--r--lib/serve.js10
2 files changed, 13 insertions, 1 deletions
diff --git a/lib/app.js b/lib/app.js
index 5d8af70..d994d04 100644
--- a/lib/app.js
+++ b/lib/app.js
@@ -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)
+ })
}
}