Skip to content

Commit 6b40bff

Browse files
committed
Use a combined attachment type
Signed-off-by: Joas Schilling <[email protected]>
1 parent f48ae40 commit 6b40bff

File tree

4 files changed

+5
-8
lines changed

4 files changed

+5
-8
lines changed

docs/constants.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,7 @@ title: Constants
125125
* `media` - Shared files with mimetype starting with image or video
126126
* `other` - Shared objects not falling into any other category
127127
* `voice` - Voice messages
128-
* `record-audio` - Audio recording file of a call
129-
* `record-video` - Audio and video recording file of a call
128+
* `recording` - Audio and video recording file of a call
130129

131130
## Poll
132131

lib/Controller/ChatController.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -819,8 +819,7 @@ public function getObjectsSharedInRoomOverview(int $limit = 7): DataResponse {
819819
Attachment::TYPE_MEDIA,
820820
Attachment::TYPE_OTHER,
821821
Attachment::TYPE_POLL,
822-
Attachment::TYPE_RECORD_AUDIO,
823-
Attachment::TYPE_RECORD_VIDEO,
822+
Attachment::TYPE_RECORDING,
824823
Attachment::TYPE_VOICE,
825824
];
826825

lib/Model/Attachment.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ class Attachment extends Entity {
4747
public const TYPE_MEDIA = 'media';
4848
public const TYPE_OTHER = 'other';
4949
public const TYPE_POLL = 'poll';
50-
public const TYPE_RECORD_AUDIO = 'record-audio';
51-
public const TYPE_RECORD_VIDEO = 'record-video';
50+
public const TYPE_RECORDING = 'recording';
5251
public const TYPE_VOICE = 'voice';
5352

5453
/** @var int */

lib/Service/AttachmentService.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ public function createAttachmentEntry(Room $room, IComment $comment, string $mes
6262
$mimetype = $parameters['metaData']['mimeType'] ?? '';
6363

6464
if ($messageType === 'record-audio') {
65-
$attachment->setObjectType(Attachment::TYPE_RECORD_AUDIO);
65+
$attachment->setObjectType(Attachment::TYPE_RECORDING);
6666
} elseif ($messageType === 'record-video') {
67-
$attachment->setObjectType(Attachment::TYPE_RECORD_VIDEO);
67+
$attachment->setObjectType(Attachment::TYPE_RECORDING);
6868
} elseif ($messageType === 'voice-message') {
6969
$attachment->setObjectType(Attachment::TYPE_VOICE);
7070
} elseif (str_starts_with($mimetype, 'audio/')) {

0 commit comments

Comments
 (0)