diff options
author | Joas Schilling <coding@schilljs.com> | 2019-09-19 16:09:50 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2019-09-19 16:23:55 +0300 |
commit | 57747a0d7ae43418fa241c8bf8c0b5d4378b4466 (patch) | |
tree | 05ecac787a2f044a82373e77818f47d7b850c673 /lib/Listener | |
parent | 2ea6dac6ab52838886ca509fc44599662cca4640 (diff) |
Move the "can start call" functionality into a method
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Listener')
-rw-r--r-- | lib/Listener/RestrictStartingCalls.php | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/lib/Listener/RestrictStartingCalls.php b/lib/Listener/RestrictStartingCalls.php index 35246838f..279ba6c2d 100644 --- a/lib/Listener/RestrictStartingCalls.php +++ b/lib/Listener/RestrictStartingCalls.php @@ -60,17 +60,7 @@ class RestrictStartingCalls { /** @var Participant $participant */ $participant = $room->getParticipantBySession($sessionId); - $defaultStartCall = (int) $this->config->getAppValue('spreed', 'start_calls', Room::START_CALL_EVERYONE); - $canStartCall = false; - if ($defaultStartCall === Room::START_CALL_EVERYONE) { - $canStartCall = true; - } else if ($defaultStartCall === Room::START_CALL_USERS && (!$participant->isGuest() || $participant->hasModeratorPermissions())) { - $canStartCall = true; - } else if ($defaultStartCall === Room::START_CALL_MODERATORS && $participant->hasModeratorPermissions()) { - $canStartCall = true; - } - - if (!$canStartCall && !$room->hasSessionsInCall()) { + if (!$participant->canStartCall() && !$room->hasSessionsInCall()) { throw new ForbiddenException('Can not start a call'); } } |