diff options
-rw-r--r-- | lib/serve.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/serve.js b/lib/serve.js index 7b4ee55..00c2968 100644 --- a/lib/serve.js +++ b/lib/serve.js @@ -692,12 +692,16 @@ Serve.prototype.id = function (id, ext) { var rootContent = rootMsg && rootMsg.value && rootMsg.value.content var recps = rootContent && rootContent.recps var threadRootId = rootContent && rootContent.root || id - var channel = rootContent && rootContent.channel + var channel pull( cat([pull.once(rootMsg), self.app.sbot.links({dest: id, values: true})]), pull.unique('key'), self.app.unboxMessages(), + pull.through(function (msg) { + var c = msg && msg.value.content + if (!channel && c.channel) channel = c.channel + }), pull.collect(function (err, links) { if (err) return self.respond(500, err.stack || err) pull( |