Skip to content

Commit

Permalink
fixup! fix(conversations): fix password enforcement logic error
Browse files Browse the repository at this point in the history
  • Loading branch information
miaulalala committed Dec 5, 2024
1 parent bafbe39 commit 1e72f3c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/Service/RoomService.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,11 @@ public function createConversation(int $type, string $name, ?IUser $owner = null
}

if ($type === Room::TYPE_PUBLIC && $password === '' && $this->config->isPasswordEnforced() === true) {
throw new InvalidArgumentException('password');
throw new PasswordException(PasswordException::REASON_VALUE, $this->l10n->t('Password needs to be set'));
}

if ($type !== Room::TYPE_PUBLIC) {
$room = $this->manager->createRoom($type, $name, $objectType, $objectId);
} elseif ($password === '') {
throw new PasswordException(PasswordException::REASON_VALUE, $this->l10n->t('Password needs to be set'));
} else {
$event = new ValidatePasswordPolicyEvent($password);
try {
Expand Down

0 comments on commit 1e72f3c

Please sign in to comment.