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

[stable29] fix(moderator): Allow promoting self-joined participants to moderators #14081

Merged
merged 1 commit into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/Controller/RoomController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1994,7 +1994,8 @@ protected function changeParticipantType(int $attendeeId, bool $promote): DataRe
return new DataResponse([], Http::STATUS_BAD_REQUEST);
}

if ($attendee->getParticipantType() === Participant::USER) {
if ($attendee->getParticipantType() === Participant::USER
|| $attendee->getParticipantType() === Participant::USER_SELF_JOINED) {
$newType = Participant::MODERATOR;
} elseif ($attendee->getParticipantType() === Participant::GUEST) {
$newType = Participant::GUEST_MODERATOR;
Expand Down
2 changes: 1 addition & 1 deletion lib/Service/ParticipantService.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public function updateParticipantType(Room $room, Participant $participant, int
$attendee->setLastAttendeeActivity($this->timeFactory->getTime());
$this->attendeeMapper->update($attendee);

// XOR so we don't move the participant in and out when they are changed from moderator to owner or vice-versa
// XOR so we don't move the participant in and out when they are changed from moderator to owner or vice versa
if (($promotedToModerator xor $demotedFromModerator) && $room->getBreakoutRoomMode() !== BreakoutRoom::MODE_NOT_CONFIGURED) {
/** @var Manager $manager */
$manager = Server::get(Manager::class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,24 @@ Feature: conversation-2/promotion-demotion
| users | participant2 | SJLAVPM |
| users | participant3 | SJAVPM |

Scenario: Moderator promotes self-joined user
Given user "participant1" creates room "room" (v4)
| roomType | 3 |
| roomName | room |
And user "participant2" joins room "room" with 200 (v4)
And user "participant2" is participant of the following rooms (v4)
| id | type | participantType |
| room | 3 | 5 |
And user "participant1" loads attendees attendee ids in room "room" (v4)
And user "participant1" promotes "participant2" in room "room" with 200 (v4)
And user "participant2" is participant of the following rooms (v4)
| id | type | participantType |
| room | 3 | 2 |
When user "participant1" demotes "participant2" in room "room" with 200 (v4)
Then user "participant2" is participant of the following rooms (v4)
| id | type | participantType |
| room | 3 | 3 |

Scenario: User promotes/demotes moderator
Given user "participant1" creates room "room" (v4)
| roomType | 3 |
Expand Down
Loading