From 926c9c4ea2a0d4bf24c6d31763e3ac22bdb655e2 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 29 Oct 2020 19:50:09 +0100 Subject: [PATCH 1/2] =?UTF-8?q?Also=20delete=20the=20room=20if=20the=20las?= =?UTF-8?q?t=20moderator=20leaves=20=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Joas Schilling --- lib/Controller/RoomController.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Controller/RoomController.php b/lib/Controller/RoomController.php index ab28622d1ab..37e0f605522 100644 --- a/lib/Controller/RoomController.php +++ b/lib/Controller/RoomController.php @@ -1097,7 +1097,9 @@ protected function removeSelfFromRoomLogic(Room $room, Participant $participant) && $room->getNumberOfModerators() === 1) { return new DataResponse([], Http::STATUS_BAD_REQUEST); } - } elseif ($room->getType() !== Room::CHANGELOG_CONVERSATION && + } + + if ($room->getType() !== Room::CHANGELOG_CONVERSATION && $room->getNumberOfParticipants() === 1) { $room->deleteRoom(); return new DataResponse(); From 07fdbce6a3460ca795d0973245f88cbb39d4c01f Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 30 Oct 2020 09:29:24 +0100 Subject: [PATCH 2/2] Keep file rooms Signed-off-by: Joas Schilling --- lib/Controller/RoomController.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Controller/RoomController.php b/lib/Controller/RoomController.php index 37e0f605522..2547e4903de 100644 --- a/lib/Controller/RoomController.php +++ b/lib/Controller/RoomController.php @@ -1100,6 +1100,7 @@ protected function removeSelfFromRoomLogic(Room $room, Participant $participant) } if ($room->getType() !== Room::CHANGELOG_CONVERSATION && + $room->getObjectType() !== 'file' && $room->getNumberOfParticipants() === 1) { $room->deleteRoom(); return new DataResponse();