Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2021-01-05 17:57:29 +0300
committerJoas Schilling <coding@schilljs.com>2021-01-05 18:35:28 +0300
commit712382fed8d45c17e756ef34b1237e111e925b8a (patch)
treefa2856dab5a1df80f35698e69f6d73a72bd03f10 /lib/Controller
parent8bc714d14cdfc3eb688a36fb5891ee82fe2d98f5 (diff)
Don't remove a chat when a self-joined user leaves
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Controller')
-rw-r--r--lib/Controller/RoomController.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Controller/RoomController.php b/lib/Controller/RoomController.php
index 6371f131e..c7f0e80a0 100644
--- a/lib/Controller/RoomController.php
+++ b/lib/Controller/RoomController.php
@@ -1381,7 +1381,12 @@ class RoomController extends AEnvironmentAwareController {
if ($room->getType() !== Room::CHANGELOG_CONVERSATION &&
$room->getObjectType() !== 'file' &&
- $this->participantService->getNumberOfUsers($room) === 1) {
+ $this->participantService->getNumberOfUsers($room) === 1 &&
+ \in_array($participant->getAttendee()->getParticipantType(), [
+ Participant::USER,
+ Participant::MODERATOR,
+ Participant::OWNER,
+ ], true)) {
$room->deleteRoom();
return new DataResponse();
}