aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/serve.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/serve.js b/lib/serve.js
index 1d8d8af..6aed742 100644
--- a/lib/serve.js
+++ b/lib/serve.js
@@ -2043,6 +2043,7 @@ Serve.prototype.composer = function (opts, cb) {
done(cb)
function prepareContent(cb) {
+ var done = multicb({pluck: 1})
content = {
type: 'post',
text: String(data.text).replace(/\r\n/g, '\n'),
@@ -2067,6 +2068,13 @@ Serve.prototype.composer = function (opts, cb) {
if (id) mention.link = id
else return false
}
+ if (mention.link && mention.link[0] === '&' && mention.size == null) {
+ var linkCb = done()
+ self.app.sbot.blobs.size(mention.link, function (err, size) {
+ if (!err && size != null) mention.size = size
+ linkCb()
+ })
+ }
return true
})
if (mentions.length) content.mentions = mentions
@@ -2087,7 +2095,10 @@ Serve.prototype.composer = function (opts, cb) {
content.branch = u.fromArray(opts.branches) || undefined
}
if (channel) content.channel = data.channel
- cb(null, content)
+
+ done(function (err) {
+ cb(err, content)
+ })
}
function preview(raw, cb) {