diff --git a/lib/Command/Room/TRoomCommand.php b/lib/Command/Room/TRoomCommand.php index 13f6d4efd14..c019014bd26 100644 --- a/lib/Command/Room/TRoomCommand.php +++ b/lib/Command/Room/TRoomCommand.php @@ -406,15 +406,8 @@ protected function completeParticipantValues(CompletionContext $context): array return []; } - $users = []; - $participants = $this->participantService->getParticipantsForRoom($room); - foreach ($participants as $participant) { - if ($participant->getAttendee()->getActorType() === Attendee::ACTOR_USERS - && stripos($participant->getAttendee()->getActorId(), $context->getCurrentWord()) !== false) { - $users[] = $participant->getAttendee()->getActorId(); - } - } - - return $users; + return array_filter($this->participantService->getParticipantUserIds($room), static function ($userId) use ($context) { + return stripos($userId, $context->getCurrentWord()) !== false; + }); } }