From e65bee649b3d0879a1b7e7ab8da731234e5e594e Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 2 Nov 2020 15:34:48 +0100 Subject: [PATCH] Only delete guests without a PIN Signed-off-by: Joas Schilling --- lib/Controller/SignalingController.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/Controller/SignalingController.php b/lib/Controller/SignalingController.php index 8a7ec39ec0..98547fb5bc 100644 --- a/lib/Controller/SignalingController.php +++ b/lib/Controller/SignalingController.php @@ -606,12 +606,14 @@ class SignalingController extends OCSController { $this->sessionService->updateLastPing($participant->getSession(), $this->timeFactory->getTime()); } } elseif ($action === 'leave') { - if ($participant instanceof Participant) { - if (!empty($userId)) { - $this->participantService->leaveRoomAsSession($room, $participant); - } else { - $this->participantService->removeAttendee($room, $participant, Room::PARTICIPANT_LEFT); - } + // Guests are removed completely as they don't reuse attendees, + // but this is only true for guests that joined directly. + // Emails are retained as their PIN needs to remain and stay + // valid. + if ($participant->getAttendee()->getActorType() === Attendee::ACTOR_GUESTS) { + $this->participantService->removeAttendee($room, $participant, Room::PARTICIPANT_LEFT); + } else { + $this->participantService->leaveRoomAsSession($room, $participant); } }