diff options
author | Joas Schilling <coding@schilljs.com> | 2021-12-14 10:58:07 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2021-12-14 10:58:07 +0300 |
commit | 7d2c1a7b0b82209cf01796e6dcf40c5e5f66eb71 (patch) | |
tree | 45658221ceee1dfdba4b5bd7455552e324d79c3e /lib | |
parent | 556115e620fe7fa7f298ddad7d4e86bec1ef5872 (diff) |
Fix joining open conversations with a password
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Service/ParticipantService.php | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/Service/ParticipantService.php b/lib/Service/ParticipantService.php index da15b56ed..d11bf996e 100644 --- a/lib/Service/ParticipantService.php +++ b/lib/Service/ParticipantService.php @@ -260,17 +260,16 @@ class ParticipantService { try { $attendee = $this->attendeeMapper->findByActor($room->getId(), Attendee::ACTOR_USERS, $user->getUID()); } catch (DoesNotExistException $e) { - if (!$event->getPassedPasswordProtection() && !$room->verifyPassword($password)['result']) { - throw new InvalidPasswordException('Provided password is invalid'); - } - // queried here to avoid loop deps $manager = \OC::$server->get(\OCA\Talk\Manager::class); + $isListableByUser = $manager->isRoomListableByUser($room, $user->getUID()); + + if (!$isListableByUser && !$event->getPassedPasswordProtection() && !$room->verifyPassword($password)['result']) { + throw new InvalidPasswordException('Provided password is invalid'); + } // User joining a group or public call through listing - if (($room->getType() === Room::TYPE_GROUP || $room->getType() === Room::TYPE_PUBLIC) && - $manager->isRoomListableByUser($room, $user->getUID()) - ) { + if (($room->getType() === Room::TYPE_GROUP || $room->getType() === Room::TYPE_PUBLIC) && $isListableByUser) { $this->addUsers($room, [[ 'actorType' => Attendee::ACTOR_USERS, 'actorId' => $user->getUID(), |