Skip to content

Commit fbeec62

Browse files
Merge pull request #11863 from nextcloud/bugfix/noid/fix-duplicate-share-message
fix(recording): Fix duplicate share message when sharing a recording …
2 parents cecbdac + 2dc6f2a commit fbeec62

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

lib/Chat/SystemMessage/Listener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ protected function fixMimeTypeOfVoiceMessage(ShareCreatedEvent|BeforeDuplicateSh
397397
return;
398398
}
399399

400-
if ($this->request->getParam('_route') === 'ocs.spreed.Recording.shareToChat') {
400+
if (strtolower($this->request->getParam('_route')) === 'ocs.spreed.recording.sharetochat') {
401401
return;
402402
}
403403
$room = $this->manager->getRoomByToken($share->getSharedWith());

tests/integration/features/bootstrap/FeatureContext.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2650,6 +2650,7 @@ protected function compareDataResponse(TableNode $formData = null) {
26502650
$includeReactions = in_array('reactions', $formData->getRow(0), true);
26512651
$includeReactionsSelf = in_array('reactionsSelf', $formData->getRow(0), true);
26522652
$includeLastEdit = in_array('lastEditActorId', $formData->getRow(0), true);
2653+
$includeMessageType = in_array('messageType', $formData->getRow(0), true);
26532654

26542655
$expected = $formData->getHash();
26552656
$count = count($expected);
@@ -2712,7 +2713,7 @@ protected function compareDataResponse(TableNode $formData = null) {
27122713
}
27132714
}
27142715

2715-
Assert::assertEquals($expected, array_map(function ($message, $expected) use ($includeParents, $includeReferenceId, $includeReactions, $includeReactionsSelf, $includeLastEdit) {
2716+
Assert::assertEquals($expected, array_map(function ($message, $expected) use ($includeParents, $includeReferenceId, $includeReactions, $includeReactionsSelf, $includeLastEdit, $includeMessageType) {
27162717
$data = [
27172718
'room' => self::$tokenToIdentifier[$message['token']],
27182719
'actorType' => $message['actorType'],
@@ -2730,6 +2731,9 @@ protected function compareDataResponse(TableNode $formData = null) {
27302731
if ($includeReferenceId) {
27312732
$data['referenceId'] = $message['referenceId'];
27322733
}
2734+
if ($includeMessageType) {
2735+
$data['messageType'] = $message['messageType'];
2736+
}
27332737
if (isset($expected['silent'])) {
27342738
$data['silent'] = isset($message['silent']) ? json_encode($message['silent']) : '!ISSET';
27352739
}

tests/integration/features/callapi/recording.feature

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,12 +467,25 @@ Feature: callapi/recording
467467
| spreed | recording | room1 | Transcript now available | The transcript for the call in room1 was uploaded to /Talk/Recording/ROOM(room1)/join_call.txt. |
468468
| spreed | recording | room1 | Call recording now available | The recording for the call in room1 was uploaded to /Talk/Recording/ROOM(room1)/join_call.ogg. |
469469
When user "participant1" shares file from the last notification to room "room1" with 200 (v1)
470+
Then user "participant1" sees the following system messages in room "room1" with 200 (v1)
471+
| room | actorType | actorId | actorDisplayName | systemMessage |
472+
| room1 | users | participant1 | participant1-displayname | conversation_created |
473+
And user "participant1" sees the following messages in room "room1" with 200 (v1)
474+
| room | actorType | actorId | actorDisplayName | messageType | message | messageParameters |
475+
| room1 | users | participant1 | participant1-displayname | record-audio | {file} | "IGNORE" |
470476
Then user "participant1" has the following notifications
471477
| app | object_type | object_id | subject | message |
472478
| spreed | recording | room1 | Transcript now available | The transcript for the call in room1 was uploaded to /Talk/Recording/ROOM(room1)/join_call.txt. |
473479
When user "participant1" shares file from the first notification to room "room1" with 200 (v1)
474480
Then user "participant1" has the following notifications
475481
| app | object_type | object_id | subject | message |
482+
Then user "participant1" sees the following system messages in room "room1" with 200 (v1)
483+
| room | actorType | actorId | actorDisplayName | systemMessage |
484+
| room1 | users | participant1 | participant1-displayname | conversation_created |
485+
And user "participant1" sees the following messages in room "room1" with 200 (v1)
486+
| room | actorType | actorId | actorDisplayName | messageType | message | messageParameters |
487+
| room1 | users | participant1 | participant1-displayname | record-audio | {file} | "IGNORE" |
488+
| room1 | users | participant1 | participant1-displayname | record-audio | {file} | "IGNORE" |
476489

477490
Scenario: Store recording with success but fail to transcript
478491
Given the following spreed app config is set

0 commit comments

Comments
 (0)