From 6cb556449064278bdcb1a54a7b980c2e7bc735f0 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 20 Mar 2020 14:43:12 +0100 Subject: Fix add comment in threads with deleted comments --- server/lib/activitypub/audience.ts | 2 ++ server/lib/activitypub/send/send-create.ts | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'server/lib/activitypub') diff --git a/server/lib/activitypub/audience.ts b/server/lib/activitypub/audience.ts index 9933ae2b5..551d04ae3 100644 --- a/server/lib/activitypub/audience.ts +++ b/server/lib/activitypub/audience.ts @@ -32,6 +32,8 @@ function getVideoCommentAudience ( // Send to actors we reply to for (const parentComment of threadParentComments) { + if (parentComment.isDeleted()) continue + cc.push(parentComment.Account.Actor.url) } diff --git a/server/lib/activitypub/send/send-create.ts b/server/lib/activitypub/send/send-create.ts index 8bdcf6417..e2fa061e8 100644 --- a/server/lib/activitypub/send/send-create.ts +++ b/server/lib/activitypub/send/send-create.ts @@ -80,7 +80,8 @@ async function sendCreateVideoComment (comment: MCommentOwnerVideo, t: Transacti // Add the actor that commented too actorsInvolvedInComment.push(byActor) - const parentsCommentActors = threadParentComments.map(c => c.Account.Actor) + const parentsCommentActors = threadParentComments.filter(c => !c.isDeleted()) + .map(c => c.Account.Actor) let audience: ActivityAudience if (isOrigin) { -- cgit v1.2.3