From f2df270a829355d7921636fd0c9343b38e7b39a1 Mon Sep 17 00:00:00 2001 From: silverpill Date: Mon, 19 Dec 2022 16:40:56 +0000 Subject: [PATCH] Remove duplicate inboxes when constructing OutgoingActivity --- src/activitypub/deliverer.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/activitypub/deliverer.rs b/src/activitypub/deliverer.rs index 97e5cf0..16f9fea 100644 --- a/src/activitypub/deliverer.rs +++ b/src/activitypub/deliverer.rs @@ -208,8 +208,10 @@ impl OutgoingActivity { activity: impl Serialize, recipients: Vec, ) -> Self { - let inboxes = recipients.into_iter() + let mut inboxes: Vec = recipients.into_iter() .map(|actor| actor.inbox).collect(); + inboxes.sort(); + inboxes.dedup(); Self { instance: instance.clone(), sender: sender.clone(),