diff options
-rw-r--r-- | docs/recording.md | 3 | ||||
-rw-r--r-- | lib/Service/RecordingService.php | 11 |
2 files changed, 5 insertions, 9 deletions
diff --git a/docs/recording.md b/docs/recording.md index b077e973b..a8a90e843 100644 --- a/docs/recording.md +++ b/docs/recording.md @@ -106,7 +106,6 @@ - Status code: + `200 OK` + `400 Bad Request` Error: `file`: Shared file is invalid - + `400 Bad Request` Error: `file-long-data`: Shared file have a too big name that can't stay in a message - + `400 Bad Request` Error: `send-system-message`: Failed to send the shared file as system message + + `400 Bad Request` Error: `system`: Internal system error + `403 Forbidden` When the user is not a moderator/owne + `404 Not Found` Room not found diff --git a/lib/Service/RecordingService.php b/lib/Service/RecordingService.php index 2e8abd6ed..0a7f7af2a 100644 --- a/lib/Service/RecordingService.php +++ b/lib/Service/RecordingService.php @@ -34,7 +34,6 @@ use OCA\Talk\Manager; use OCA\Talk\Participant; use OCA\Talk\Room; use OCP\AppFramework\Utility\ITimeFactory; -use OCP\Comments\MessageTooLongException; use OCP\Files\File; use OCP\Files\Folder; use OCP\Files\IMimeTypeDetector; @@ -177,7 +176,7 @@ class RecordingService { public function notificationDismiss(Room $room, Participant $participant, int $timestamp): void { $notification = $this->notificationManager->createNotification(); $notification->setApp('spreed') - ->setObject('chat', (string) $room->getToken()) + ->setObject('chat', $room->getToken()) ->setSubject('record_file_stored') ->setDateTime($this->timeFactory->getDateTime('@' . $timestamp)) ->setUser($participant->getAttendee()->getActorId()); @@ -185,8 +184,8 @@ class RecordingService { } private function getTypeOfShare(string $mimetype): string { - if (strpos($mimetype, 'video') !== false) { - return'record-video'; + if (str_starts_with($mimetype, 'video/')) { + return 'record-video'; } return 'record-audio'; } @@ -236,10 +235,8 @@ class RecordingService { $creationDateTime, true ); - } catch (MessageTooLongException $e) { - throw new InvalidArgumentException('file-long-data'); } catch (\Exception $e) { - throw new InvalidArgumentException('send-system-message'); + throw new InvalidArgumentException('system'); } $this->notificationDismiss($room, $participant, $timestamp); } |