Fix duplicate inbox deliveries

This commit is contained in:
Mint 2024-01-11 20:38:12 +03:00
parent 8bc59e9743
commit 3c30eadd5e
2 changed files with 8 additions and 2 deletions

View File

@ -255,7 +255,10 @@ def publish(%User{} = actor, %{data: %{"bcc" => bcc}} = activity)
[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 @@ def publish(%User{} = actor, %Activity{} = activity) 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)