summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorVitor Mattos <vitor@php.rio>2023-01-23 13:31:56 -0300
committerVitor Mattos <vitor@php.rio>2023-01-23 13:33:36 -0300
commit9f1d38b0980a2fb8c7736922de6dc33666b27afe (patch)
tree7cabfb97bd3191fea971f5c9133abcd225e5ef87 /lib
parent69060f003be6e1364f1748eb194887a1fab10791 (diff)
Fixes after code review
https://github.com/nextcloud/spreed/pull/8550#discussion_r1084214748 https://github.com/nextcloud/spreed/pull/8550#discussion_r1084202960 https://github.com/nextcloud/spreed/pull/8550#discussion_r1084201311 Signed-off-by: Vitor Mattos <vitor@php.rio>
Diffstat (limited to 'lib')
-rw-r--r--lib/Service/RecordingService.php11
1 files changed, 4 insertions, 7 deletions
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);
}