mirror of
https://github.com/appwrite/appwrite
synced 2026-05-23 00:49:02 +00:00
Use a set to avoid message duplication
This commit is contained in:
parent
7a8ea7278e
commit
f3fa172482
1 changed files with 3 additions and 2 deletions
|
|
@ -189,7 +189,7 @@ class Messaging extends Action
|
|||
}
|
||||
|
||||
/**
|
||||
* @var array<string, array<string>> $identifiers
|
||||
* @var array<string, array<string, null>> $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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue