aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/serve.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/serve.js b/lib/serve.js
index f8dcf65..75e84e6 100644
--- a/lib/serve.js
+++ b/lib/serve.js
@@ -1061,7 +1061,10 @@ Serve.prototype.channel = function (path) {
function threadHeads(msgs, rootId) {
return sort.heads(msgs.filter(function (msg) {
var c = msg.value && msg.value.content
- return (c && c.root === rootId)
+ return (c && (
+ c.type === 'web-root' ? c.site === rootId :
+ c.type === 'talenet-idea-comment_reply' ? c.ideaKey === rootId :
+ c.root === rootId))
|| msg.key === rootId
}))
}
@@ -1083,7 +1086,9 @@ Serve.prototype.streamThreadWithComposer = function (opts) {
|| ((rootMsg.value.private || typeof rootMsg.value.content === 'string')
? [rootMsg.value.author, self.app.sbot.id].filter(uniques())
: undefined)
- var threadRootId = rootContent && rootContent.root || id
+ var threadRootId = rootContent && (
+ rootContent.type === 'web-root' ? rootContent.site : rootContent.root
+ ) || id
var channel = opts.channel
pull(