From 165b3ff15a35e91b40ccead2dbdb0c8a894dd42c Mon Sep 17 00:00:00 2001 From: cel Date: Thu, 27 Apr 2017 20:02:45 -1000 Subject: Reply in branch channel if no root channel --- lib/serve.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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( -- cgit v1.2.3