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/Controller | |
parent | 2ea6dac6ab52838886ca509fc44599662cca4640 (diff) |
Move the "can start call" functionality into a method
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Controller')
-rw-r--r-- | lib/Controller/RoomController.php | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/lib/Controller/RoomController.php b/lib/Controller/RoomController.php index 6139431f4..4de5f77c7 100644 --- a/lib/Controller/RoomController.php +++ b/lib/Controller/RoomController.php @@ -42,7 +42,6 @@ use OCP\AppFramework\Http; use OCP\AppFramework\Http\DataResponse; use OCP\AppFramework\Utility\ITimeFactory; use OCP\Comments\IComment; -use OCP\IConfig; use OCP\IL10N; use OCP\IRequest; use OCP\IUser; @@ -55,8 +54,6 @@ use Symfony\Component\EventDispatcher\GenericEvent; class RoomController extends AEnvironmentAwareController { /** @var string|null */ private $userId; - /** @var IConfig */ - private $config; /** @var TalkSession */ private $session; /** @var IUserManager */ @@ -81,7 +78,6 @@ class RoomController extends AEnvironmentAwareController { public function __construct(string $appName, ?string $UserId, IRequest $request, - IConfig $config, TalkSession $session, IUserManager $userManager, IGroupManager $groupManager, @@ -93,7 +89,6 @@ class RoomController extends AEnvironmentAwareController { ITimeFactory $timeFactory, IL10N $l10n) { parent::__construct($appName, $request); - $this->config = $config; $this->session = $session; $this->userId = $UserId; $this->userManager = $userManager; @@ -250,14 +245,7 @@ class RoomController extends AEnvironmentAwareController { return $roomData; } - $defaultStartCall = (int) $this->config->getAppValue('spreed', 'start_calls', Room::START_CALL_EVERYONE); - if ($defaultStartCall === Room::START_CALL_EVERYONE) { - $roomData['canStartCall'] = true; - } else if ($defaultStartCall === Room::START_CALL_USERS && (!$currentParticipant->isGuest() || $currentParticipant->hasModeratorPermissions())) { - $roomData['canStartCall'] = true; - } else if ($defaultStartCall === Room::START_CALL_MODERATORS && $currentParticipant->hasModeratorPermissions()) { - $roomData['canStartCall'] = true; - } + $roomData['canStartCall'] = $currentParticipant->canStartCall(); $currentUser = $this->userManager->get($currentParticipant->getUser()); if ($currentUser instanceof IUser) { |