Skip to content

Commit

Permalink
Merge pull request #12198 from nextcloud/bugfix/noid/make-alluserids-…
Browse files Browse the repository at this point in the history
…more-reliable

fix(signaling): Make alluserids more reliable for testing
  • Loading branch information
nickvergessen authored Apr 29, 2024
2 parents 2a43ff7 + 14b4c44 commit a6aa9f6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/Signaling/BackendNotifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ public function roomInvited(Room $room, array $attendees): void {
* @throws \Exception
*/
public function roomsDisinvited(Room $room, array $attendees): void {
$allUserIds = $this->participantService->getParticipantUserIds($room);
sort($allUserIds);
$userIds = [];
foreach ($attendees as $attendee) {
if ($attendee->getActorType() === Attendee::ACTOR_USERS) {
Expand All @@ -189,7 +191,7 @@ public function roomsDisinvited(Room $room, array $attendees): void {
'userids' => $userIds,
// TODO(fancycode): We should try to get rid of 'alluserids' and
// find a better way to notify existing users to update the room.
'alluserids' => $this->participantService->getParticipantUserIds($room),
'alluserids' => $allUserIds,
'properties' => $room->getPropertiesForSignaling('', false),
],
]);
Expand All @@ -210,14 +212,16 @@ public function roomsDisinvited(Room $room, array $attendees): void {
* @throws \Exception
*/
public function roomSessionsRemoved(Room $room, array $sessionIds): void {
$allUserIds = $this->participantService->getParticipantUserIds($room);
sort($allUserIds);
$start = microtime(true);
$this->backendRequest($room, [
'type' => 'disinvite',
'disinvite' => [
'sessionids' => $sessionIds,
// TODO(fancycode): We should try to get rid of 'alluserids' and
// find a better way to notify existing users to update the room.
'alluserids' => $this->participantService->getParticipantUserIds($room),
'alluserids' => $allUserIds,
'properties' => $room->getPropertiesForSignaling('', false),
],
]);
Expand Down

0 comments on commit a6aa9f6

Please sign in to comment.