fix(ban): Don't ban the moderator but the provided actor

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2024-07-02 08:54:20 +02:00
parent 856fda5b49
commit d6cf2f2ff2
No known key found for this signature in database
GPG key ID: 74434EFE0D2E2205

View file

@ -48,17 +48,16 @@ class BanController extends AEnvironmentAwareController {
#[RequireModeratorParticipant]
public function banActor(string $actorType, string $actorId, string $internalNote = ''): DataResponse {
try {
$attendee = $this->participant->getAttendee();
$roomId = $attendee->getRoomId();
$bannedId = $attendee->getActorId();
$bannedType = $attendee->getActorType();
$moderator = $this->participant->getAttendee();
$moderatorActorType = $moderator->getActorType();
$moderatorActorId = $moderator->getActorId();
$ban = $this->banService->createBan(
$moderatorActorId,
$moderatorActorType,
$this->room->getId(),
$actorId,
$actorType,
$roomId,
$bannedId,
$bannedType,
null,
$internalNote
);