diff options
author | Joas Schilling <coding@schilljs.com> | 2023-10-11 12:29:41 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2023-10-23 15:48:00 +0200 |
commit | 0ca97658d0d826c8bb488a5550cb86b218da3da3 (patch) | |
tree | 4790a2b08367450adb7f281cee77c1bb3ac948ee | |
parent | 99b4c1f64a9853e1c540066619f854d4e09f24de (diff) |
Avoid circular dependency
Signed-off-by: Joas Schilling <coding@schilljs.com>
-rw-r--r-- | lib/Controller/CallController.php | 4 | ||||
-rw-r--r-- | lib/Service/ParticipantService.php | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/lib/Controller/CallController.php b/lib/Controller/CallController.php index be76507c6..dd7de7dc2 100644 --- a/lib/Controller/CallController.php +++ b/lib/Controller/CallController.php @@ -43,6 +43,7 @@ use OCA\Talk\Service\ConsentService; use OCA\Talk\Service\ParticipantService; use OCA\Talk\Service\RecordingService; use OCA\Talk\Service\RoomService; +use OCA\Talk\Service\SIPDialOutService; use OCP\AppFramework\Http; use OCP\AppFramework\Http\Attribute\PublicPage; use OCP\AppFramework\Http\DataResponse; @@ -64,6 +65,7 @@ class CallController extends AEnvironmentAwareController { private IUserManager $userManager, private ITimeFactory $timeFactory, private Config $talkConfig, + private SIPDialOutService $dialOutService, ) { parent::__construct($appName, $request); } @@ -226,7 +228,7 @@ class CallController extends AEnvironmentAwareController { } try { - $this->participantService->startDialOutRequest($this->room, $attendeeId); + $this->participantService->startDialOutRequest($this->dialOutService, $this->room, $attendeeId); } catch (ParticipantNotFoundException) { return new DataResponse([], Http::STATUS_NOT_FOUND); } catch (\InvalidArgumentException) { diff --git a/lib/Service/ParticipantService.php b/lib/Service/ParticipantService.php index 49b63b64c..292cfba00 100644 --- a/lib/Service/ParticipantService.php +++ b/lib/Service/ParticipantService.php @@ -120,7 +120,6 @@ class ParticipantService { private BackendNotifier $backendNotifier, private ITimeFactory $timeFactory, private ICacheFactory $cacheFactory, - protected SIPDialOutService $dialOutService, ) { } @@ -1240,7 +1239,7 @@ class ParticipantService { * @throws \InvalidArgumentException * @throws ParticipantNotFoundException */ - public function startDialOutRequest(Room $room, int $targetAttendeeId): void { + public function startDialOutRequest(SIPDialOutService $dialOutService, Room $room, int $targetAttendeeId): void { try { $attendee = $this->attendeeMapper->getById($targetAttendeeId); } catch (DoesNotExistException|MultipleObjectsReturnedException|Exception) { @@ -1255,7 +1254,7 @@ class ParticipantService { throw new ParticipantNotFoundException(); } - $dialOutResponse = $this->dialOutService->sendDialOutRequestToBackend($room, $attendee); + $dialOutResponse = $dialOutService->sendDialOutRequestToBackend($room, $attendee); if (!$dialOutResponse) { throw new \InvalidArgumentException('backend'); |