Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(recording): Fix duplicate share message when sharing a recording … #11863

Merged
merged 1 commit into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/Chat/SystemMessage/Listener.php
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ protected function fixMimeTypeOfVoiceMessage(ShareCreatedEvent|BeforeDuplicateSh
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());
Expand Down
6 changes: 5 additions & 1 deletion tests/integration/features/bootstrap/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -2650,6 +2650,7 @@ protected function compareDataResponse(TableNode $formData = null) {
$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);
Expand Down Expand Up @@ -2712,7 +2713,7 @@ protected function compareDataResponse(TableNode $formData = null) {
}
}

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'],
Expand All @@ -2730,6 +2731,9 @@ protected function compareDataResponse(TableNode $formData = null) {
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';
}
Expand Down
13 changes: 13 additions & 0 deletions tests/integration/features/callapi/recording.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading