summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2024-03-19 17:03:44 +0100
committerGitHub <noreply@github.com>2024-03-19 17:03:44 +0100
commitfbeec6258cfdf98518b3094e1ff51630ec4302d8 (patch)
tree32e14ee6a4d235fc86ac8c55d3382806f5ff0e85
parentcecbdac1b491113def0db3750e419846b7efe13d (diff)
parent2dc6f2a785b5a48e1748777f40ecad887167d3d0 (diff)
Merge pull request #11863 from nextcloud/bugfix/noid/fix-duplicate-share-message
fix(recording): Fix duplicate share message when sharing a recording …
-rw-r--r--lib/Chat/SystemMessage/Listener.php2
-rw-r--r--tests/integration/features/bootstrap/FeatureContext.php6
-rw-r--r--tests/integration/features/callapi/recording.feature13
3 files changed, 19 insertions, 2 deletions
diff --git a/lib/Chat/SystemMessage/Listener.php b/lib/Chat/SystemMessage/Listener.php
index 3564de06a..d03aedf8d 100644
--- a/lib/Chat/SystemMessage/Listener.php
+++ b/lib/Chat/SystemMessage/Listener.php
@@ -397,7 +397,7 @@ class Listener implements IEventListener {
return;
}
- if ($this->request->getParam('_route') === 'ocs.spreed.Recording.shareToChat') {
+ if (strtolower($this->request->getParam('_route')) === 'ocs.spreed.recording.sharetochat') {
return;
}
$room = $this->manager->getRoomByToken($share->getSharedWith());
diff --git a/tests/integration/features/bootstrap/FeatureContext.php b/tests/integration/features/bootstrap/FeatureContext.php
index 00018426b..7fa4beb2a 100644
--- a/tests/integration/features/bootstrap/FeatureContext.php
+++ b/tests/integration/features/bootstrap/FeatureContext.php
@@ -2650,6 +2650,7 @@ class FeatureContext implements Context, SnippetAcceptingContext {
$includeReactions = in_array('reactions', $formData->getRow(0), true);
$includeReactionsSelf = in_array('reactionsSelf', $formData->getRow(0), true);
$includeLastEdit = in_array('lastEditActorId', $formData->getRow(0), true);
+ $includeMessageType = in_array('messageType', $formData->getRow(0), true);
$expected = $formData->getHash();
$count = count($expected);
@@ -2712,7 +2713,7 @@ class FeatureContext implements Context, SnippetAcceptingContext {
}
}
- Assert::assertEquals($expected, array_map(function ($message, $expected) use ($includeParents, $includeReferenceId, $includeReactions, $includeReactionsSelf, $includeLastEdit) {
+ Assert::assertEquals($expected, array_map(function ($message, $expected) use ($includeParents, $includeReferenceId, $includeReactions, $includeReactionsSelf, $includeLastEdit, $includeMessageType) {
$data = [
'room' => self::$tokenToIdentifier[$message['token']],
'actorType' => $message['actorType'],
@@ -2730,6 +2731,9 @@ class FeatureContext implements Context, SnippetAcceptingContext {
if ($includeReferenceId) {
$data['referenceId'] = $message['referenceId'];
}
+ if ($includeMessageType) {
+ $data['messageType'] = $message['messageType'];
+ }
if (isset($expected['silent'])) {
$data['silent'] = isset($message['silent']) ? json_encode($message['silent']) : '!ISSET';
}
diff --git a/tests/integration/features/callapi/recording.feature b/tests/integration/features/callapi/recording.feature
index bf819b988..cef1d14b6 100644
--- a/tests/integration/features/callapi/recording.feature
+++ b/tests/integration/features/callapi/recording.feature
@@ -467,12 +467,25 @@ Feature: callapi/recording
| spreed | recording | room1 | Transcript now available | The transcript for the call in room1 was uploaded to /Talk/Recording/ROOM(room1)/join_call.txt. |
| spreed | recording | room1 | Call recording now available | The recording for the call in room1 was uploaded to /Talk/Recording/ROOM(room1)/join_call.ogg. |
When user "participant1" shares file from the last notification to room "room1" with 200 (v1)
+ Then user "participant1" sees the following system messages in room "room1" with 200 (v1)
+ | room | actorType | actorId | actorDisplayName | systemMessage |
+ | room1 | users | participant1 | participant1-displayname | conversation_created |
+ And user "participant1" sees the following messages in room "room1" with 200 (v1)
+ | room | actorType | actorId | actorDisplayName | messageType | message | messageParameters |
+ | room1 | users | participant1 | participant1-displayname | record-audio | {file} | "IGNORE" |
Then user "participant1" has the following notifications
| app | object_type | object_id | subject | message |
| spreed | recording | room1 | Transcript now available | The transcript for the call in room1 was uploaded to /Talk/Recording/ROOM(room1)/join_call.txt. |
When user "participant1" shares file from the first notification to room "room1" with 200 (v1)
Then user "participant1" has the following notifications
| app | object_type | object_id | subject | message |
+ Then user "participant1" sees the following system messages in room "room1" with 200 (v1)
+ | room | actorType | actorId | actorDisplayName | systemMessage |
+ | room1 | users | participant1 | participant1-displayname | conversation_created |
+ And user "participant1" sees the following messages in room "room1" with 200 (v1)
+ | room | actorType | actorId | actorDisplayName | messageType | message | messageParameters |
+ | room1 | users | participant1 | participant1-displayname | record-audio | {file} | "IGNORE" |
+ | room1 | users | participant1 | participant1-displayname | record-audio | {file} | "IGNORE" |
Scenario: Store recording with success but fail to transcript
Given the following spreed app config is set