From f3fa1724826a3eff6ab3ae3957ffd7f799a6c1b8 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 28 Feb 2024 01:01:39 +1300 Subject: [PATCH] Use a set to avoid message duplication --- src/Appwrite/Platform/Workers/Messaging.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Appwrite/Platform/Workers/Messaging.php b/src/Appwrite/Platform/Workers/Messaging.php index 58d7d31b15..ab3a9a41b1 100644 --- a/src/Appwrite/Platform/Workers/Messaging.php +++ b/src/Appwrite/Platform/Workers/Messaging.php @@ -189,7 +189,7 @@ class Messaging extends Action } /** - * @var array> $identifiers + * @var array> $identifiers */ $identifiers = []; @@ -211,7 +211,8 @@ class Messaging extends Action if (!\array_key_exists($providerId, $identifiers)) { $identifiers[$providerId] = []; } - $identifiers[$providerId][] = $recipient->getAttribute('identifier'); + // Use null as value to avoid duplicate keys + $identifiers[$providerId][$target->getAttribute('identifier')] = null; } }