Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix clearing of guests #9517

Merged
merged 2 commits into from May 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 7 additions & 2 deletions lib/Service/ParticipantService.php
Expand Up @@ -1010,8 +1010,9 @@ public function cleanGuestParticipants(Room $room): void {
continue;
}

if ($row['permissions'] !== Attendee::PERMISSIONS_DEFAULT
|| $row['participant_type'] === Participant::GUEST_MODERATOR) {
if ((int) $row['participant_type'] !== Participant::GUEST
|| ((int) $row['permissions'] !== Attendee::PERMISSIONS_DEFAULT
&& (int) $row['permissions'] !== Attendee::PERMISSIONS_CUSTOM)) {
// Keep guests with non-default permissions in case they just reconnect
continue;
}
Expand All @@ -1021,6 +1022,10 @@ public function cleanGuestParticipants(Room $room): void {
}
$result->closeCursor();

if (empty($attendeeIds)) {
return;
}

$this->attendeeMapper->deleteByIds($attendeeIds);

$attendeeEvent = new AttendeesRemovedEvent($room, $attendees);
Expand Down