Browse Source
Fix joining open conversations with a password
Signed-off-by: Joas Schilling <coding@schilljs.com>
pull/6701/head
Joas Schilling
4 years ago
No known key found for this signature in database
GPG Key ID: 7076EA9751AACDDA
1 changed files with
6 additions and
7 deletions
-
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(), |
|
|
|
|