summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVitor Mattos <vitor@php.rio>2023-02-27 15:40:16 -0300
committerVitor Mattos <vitor@php.rio>2023-02-27 20:36:19 -0300
commit16070288ad3da2177e1d50019d42a1a4a6b64f7a (patch)
tree42560164195321f3fc1e5925583737f73cff7387
parent07fb57db5914ee00fd0005626c9bc3360610fcfd (diff)
Change type of notification
Change type of notification Add the new type to be deleted Signed-off-by: Vitor Mattos <vitor@php.rio>
-rw-r--r--lib/Chat/Notifier.php12
-rw-r--r--lib/Service/RecordingService.php2
-rw-r--r--tests/integration/features/callapi/recording.feature4
-rw-r--r--tests/php/Chat/NotifierTest.php16
4 files changed, 19 insertions, 15 deletions
diff --git a/lib/Chat/Notifier.php b/lib/Chat/Notifier.php
index 4435f80eb..26e1ad441 100644
--- a/lib/Chat/Notifier.php
+++ b/lib/Chat/Notifier.php
@@ -314,8 +314,16 @@ class Notifier {
// @todo this should be in the Notifications\Hooks
$notification->setApp('spreed');
- $notification->setObject('chat', $chat->getToken());
- $this->notificationManager->markProcessed($notification);
+ $objectTypes = [
+ 'chat',
+ 'recording',
+ 'recording_information',
+ 'remote_talk_share',
+ ];
+ foreach ($objectTypes as $type) {
+ $notification->setObject($type, $chat->getToken());
+ $this->notificationManager->markProcessed($notification);
+ }
if (!$chatOnly) {
$notification->setObject('room', $chat->getToken());
diff --git a/lib/Service/RecordingService.php b/lib/Service/RecordingService.php
index 92c7d855d..0e3ef118b 100644
--- a/lib/Service/RecordingService.php
+++ b/lib/Service/RecordingService.php
@@ -148,7 +148,7 @@ class RecordingService {
$notification
->setApp('spreed')
->setDateTime($this->timeFactory->getDateTime())
- ->setObject('recording', $room->getToken())
+ ->setObject('recording_information', $room->getToken())
->setUser($participant->getAttendee()->getActorId())
->setSubject('record_file_store_fail');
$this->notificationManager->notify($notification);
diff --git a/tests/integration/features/callapi/recording.feature b/tests/integration/features/callapi/recording.feature
index 0203ce340..6f59cdaa5 100644
--- a/tests/integration/features/callapi/recording.feature
+++ b/tests/integration/features/callapi/recording.feature
@@ -393,8 +393,8 @@ Feature: callapi/recording
And user "participant1" joins room "room1" with 200 (v4)
When user "participant1" store recording file "big" in room "room1" with 400 (v1)
Then user "participant1" has the following notifications
- | app | object_type | object_id | subject |
- | spreed | recording | room1 | Failed to store recording of call room1, reach out to the admin. |
+ | app | object_type | object_id | subject |
+ | spreed | recording_information | room1 | Failed to store recording of call room1, reach out to the admin. |
And user "participant1" is participant of the following unordered rooms (v4)
| type | name | callRecording |
| 2 | room1 | 0 |
diff --git a/tests/php/Chat/NotifierTest.php b/tests/php/Chat/NotifierTest.php
index 5a5636b24..944321079 100644
--- a/tests/php/Chat/NotifierTest.php
+++ b/tests/php/Chat/NotifierTest.php
@@ -282,16 +282,12 @@ class NotifierTest extends TestCase {
->with('spreed')
->willReturnSelf();
- $notification->expects($this->exactly(3))
+ $notification->expects($this->atLeastOnce())
->method('setObject')
- ->withConsecutive(
- ['chat', 'Token123'],
- ['room', 'Token123'],
- ['call', 'Token123']
- )
+ ->with($this->anything(), 'Token123')
->willReturnSelf();
- $this->notificationManager->expects($this->exactly(3))
+ $this->notificationManager->expects($this->atLeastOnce())
->method('markProcessed')
->with($notification);
@@ -315,12 +311,12 @@ class NotifierTest extends TestCase {
->with('spreed')
->willReturnSelf();
- $notification->expects($this->exactly(1))
+ $notification->expects($this->atLeastOnce())
->method('setObject')
- ->with('chat', 'Token123')
+ ->with($this->anything(), 'Token123')
->willReturnSelf();
- $this->notificationManager->expects($this->exactly(1))
+ $this->notificationManager->expects($this->atLeastOnce())
->method('markProcessed')
->with($notification);