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
parent
commit
7d2c1a7b0b
No known key found for this signature in database GPG Key ID: 7076EA9751AACDDA
  1. 13
      lib/Service/ParticipantService.php

13
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(),

Loading…
Cancel
Save