diff options
author | Vitor Mattos <vitor@php.rio> | 2022-12-26 20:37:05 -0300 |
---|---|---|
committer | Vitor Mattos <vitor@php.rio> | 2022-12-26 20:37:05 -0300 |
commit | 60597b159618c71ec1ded65a29d4f4d3a618cf34 (patch) | |
tree | 4ad219c558e681c01cb7b55d84c21ffaefbdf8f6 /lib/Controller/RecordingController.php | |
parent | 4f87dc3a0b91c52adba7ab13aa73694f2aad7220 (diff) |
Validate and store record file
Signed-off-by: Vitor Mattos <vitor@php.rio>
Diffstat (limited to 'lib/Controller/RecordingController.php')
-rw-r--r-- | lib/Controller/RecordingController.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Controller/RecordingController.php b/lib/Controller/RecordingController.php index f94e01e02..07cd285ae 100644 --- a/lib/Controller/RecordingController.php +++ b/lib/Controller/RecordingController.php @@ -32,10 +32,12 @@ use OCA\Talk\Service\RoomService; use OCA\Talk\Service\SIPBridgeService; use OCP\AppFramework\Http; use OCP\AppFramework\Http\DataResponse; +use OCP\Files\IRootFolder; use OCP\IRequest; class RecordingController extends AEnvironmentAwareController { private Config $talkConfig; + private IRootFolder $rootFolder; private SIPBridgeService $SIPBridgeService; private RoomService $roomService; @@ -43,10 +45,12 @@ class RecordingController extends AEnvironmentAwareController { public function __construct(string $appName, IRequest $request, Config $talkConfig, + IRootFolder $rootFolder, SIPBridgeService $SIPBridgeService, RoomService $roomService) { parent::__construct($appName, $request); $this->talkConfig = $talkConfig; + $this->rootFolder = $rootFolder; $this->SIPBridgeService = $SIPBridgeService; $this->roomService = $roomService; } @@ -100,7 +104,7 @@ class RecordingController extends AEnvironmentAwareController { try { $file = $this->request->getUploadedFile('file'); - $this->roomService->storeRecording($this->getRoom(), $owner, $file); + $this->roomService->storeRecording($this->getRoom(), $owner, $file, $this->rootFolder); } catch (InvalidArgumentException $e) { return new DataResponse(['error' => $e->getMessage()], Http::STATUS_BAD_REQUEST); } |