From b2664ba7a9e9d7267c86ae951adfdd9f857a4f63 Mon Sep 17 00:00:00 2001 From: Daniel Rudolf Date: Wed, 6 May 2020 11:10:55 +0200 Subject: Don't demote room owners to moderators in talk:room:promote command Signed-off-by: Daniel Rudolf --- lib/Command/Room/TRoomCommand.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/Command/Room/TRoomCommand.php b/lib/Command/Room/TRoomCommand.php index 03289d65f..b7aa1361e 100644 --- a/lib/Command/Room/TRoomCommand.php +++ b/lib/Command/Room/TRoomCommand.php @@ -184,10 +184,14 @@ trait TRoomCommand $participants = []; foreach ($userIds as $userId) { try { - $participants[] = $room->getParticipant($userId); + $participant = $room->getParticipant($userId); } catch (ParticipantNotFoundException $e) { throw new InvalidArgumentException(sprintf("User '%s' is no participant.", $userId)); } + + if ($participant->getParticipantType() !== Participant::OWNER) { + $participants[] = $participant; + } } foreach ($participants as $participant) { -- cgit v1.2.3