summaryrefslogtreecommitdiffstats
path: root/lib/Notification/Notifier.php
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2023-04-17 17:30:25 +0200
committerJoas Schilling <coding@schilljs.com>2023-04-20 14:44:49 +0200
commit832ca68b00a86b2e84873ad1053b841f48ff5f46 (patch)
treefcdfc7867739513eab1c7fea5d8b4e2162cb3488 /lib/Notification/Notifier.php
parent7bbf1cd28925a77eff597ce475778c5d2fadb5e6 (diff)
feat(recording): Automatically generate transcripts of call recordings when possible
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Notification/Notifier.php')
-rw-r--r--lib/Notification/Notifier.php27
1 files changed, 21 insertions, 6 deletions
diff --git a/lib/Notification/Notifier.php b/lib/Notification/Notifier.php
index 8abf38edf..489fd901e 100644
--- a/lib/Notification/Notifier.php
+++ b/lib/Notification/Notifier.php
@@ -265,7 +265,7 @@ class Notifier implements INotifier {
->setLink($this->url->linkToRouteAbsolute('spreed.Page.showCall', ['token' => $room->getToken()]));
$subject = $notification->getSubject();
- if ($subject === 'record_file_stored') {
+ if ($subject === 'record_file_stored' || $subject === 'transcript_file_stored' || $subject === 'transcript_failed') {
return $this->parseStoredRecording($notification, $room, $participant, $l);
}
if ($subject === 'record_file_store_fail') {
@@ -382,10 +382,21 @@ class Notifier implements INotifier {
IAction::TYPE_DELETE
);
+ if ($notification->getSubject() === 'record_file_stored') {
+ $subject = $l->t('Call recording now available');
+ $message = $l->t('The recording for the call in {call} was uploaded to {file}.');
+ } else if ($notification->getSubject() === 'transcript_file_stored') {
+ $subject = $l->t('Transcript now available');
+ $message = $l->t('The transcript for the call in {call} was uploaded to {file}.');
+ } else {
+ $subject = $l->t('Failed to transcript call recording');
+ $message = $l->t('The server failed to transcript the recording at {file} for the call in {call}. Please reach out to the administration.');
+ }
+
$notification
- ->setRichSubject($l->t('Call recording now available'))
+ ->setRichSubject($subject)
->setRichMessage(
- $l->t('The recording for the call in {call} was uploaded to {file}.'),
+ $message,
[
'call' => [
'type' => 'call',
@@ -401,9 +412,13 @@ class Notifier implements INotifier {
'path' => $path,
'link' => $this->url->linkToRouteAbsolute('files.viewcontroller.showFile', ['fileid' => $file->getId()]),
],
- ])
- ->addParsedAction($shareAction)
- ->addParsedAction($dismissAction);
+ ]);
+
+ if ($notification->getSubject() !== 'transcript_failed') {
+ $notification->addParsedAction($shareAction);
+ $notification->addParsedAction($dismissAction);
+ }
+
return $notification;
}