From 9c7468a725a4bb07df5c586bf4675fefbea27ee1 Mon Sep 17 00:00:00 2001 From: Maxence Lange Date: Fri, 8 Oct 2021 11:16:27 -0100 Subject: [PATCH 1/2] fix extraction of instance on result Signed-off-by: Maxence Lange --- lib/Search/GlobalScaleUsers.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/Search/GlobalScaleUsers.php b/lib/Search/GlobalScaleUsers.php index cfeb7f142..acb2a38f2 100644 --- a/lib/Search/GlobalScaleUsers.php +++ b/lib/Search/GlobalScaleUsers.php @@ -102,7 +102,12 @@ public function search($search) { $result = []; foreach ($users as $user) { - list(, $instance) = explode('@', $this->get('federationId', $user), 2); + $cloudId = $this->get('federationId', $user); + $pos = strrpos($cloudId, '@'); + if ($pos === false) { + continue; + } + $instance = substr($cloudId, $pos + 1); if ($this->configService->isLocalInstance($instance)) { continue; } From 05152f8c798635afa76c8ba8508ef14ee6859e5b Mon Sep 17 00:00:00 2001 From: Maxence Lange Date: Mon, 25 Oct 2021 11:38:47 -0100 Subject: [PATCH 2/2] avoid duplicate recipients Signed-off-by: Maxence Lange --- lib/GlobalScale/MemberAdd.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/GlobalScale/MemberAdd.php b/lib/GlobalScale/MemberAdd.php index 14f79cc39..edacecb05 100644 --- a/lib/GlobalScale/MemberAdd.php +++ b/lib/GlobalScale/MemberAdd.php @@ -214,7 +214,13 @@ public function result(array $events): void { $recipients = [$member->getUserId()]; } + $done = []; foreach ($recipients as $recipient) { + if (in_array($recipient, $done)) { + continue; + } + + $done[] = $recipient; $this->memberIsMailbox($circle, $recipient, $links, $password); } }