From 3c30eadd5ede822d6310d3ce6534d26d7caf41f5 Mon Sep 17 00:00:00 2001 From: Mint Date: Thu, 11 Jan 2024 20:38:12 +0300 Subject: [PATCH] Fix duplicate inbox deliveries --- changelog.d/fix-duplicate-inbox-deliveries.fix | 0 lib/pleroma/web/activity_pub/publisher.ex | 10 ++++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 changelog.d/fix-duplicate-inbox-deliveries.fix diff --git a/changelog.d/fix-duplicate-inbox-deliveries.fix b/changelog.d/fix-duplicate-inbox-deliveries.fix new file mode 100644 index 000000000..e69de29bb diff --git a/lib/pleroma/web/activity_pub/publisher.ex b/lib/pleroma/web/activity_pub/publisher.ex index cc47b3d27..fb7c6f005 100644 --- a/lib/pleroma/web/activity_pub/publisher.ex +++ b/lib/pleroma/web/activity_pub/publisher.ex @@ -255,7 +255,10 @@ defmodule Pleroma.Web.ActivityPub.Publisher do [priority_recipients, recipients] |> Enum.map(fn recipients -> recipients - |> Enum.map(fn actor -> actor.inbox end) + |> Enum.map(fn %User{} = user -> + determine_inbox(activity, user) + end) + |> Enum.uniq() |> Enum.filter(fn inbox -> should_federate?(inbox, public) end) |> Instances.filter_reachable() end) @@ -302,7 +305,10 @@ defmodule Pleroma.Web.ActivityPub.Publisher do recipients(actor, activity) |> Enum.map(fn recipients -> recipients - |> Enum.map(fn actor -> actor.inbox end) + |> Enum.map(fn %User{} = user -> + determine_inbox(activity, user) + end) + |> Enum.uniq() |> Enum.filter(fn inbox -> should_federate?(inbox, public) end) end)