Skip to content

Commit

Permalink
/issues/4753 - Allow audio file attachments to be played back inline …
Browse files Browse the repository at this point in the history
…by reusing the existing voice message UI.
  • Loading branch information
stefanceriu committed Dec 2, 2021
1 parent 67c5bff commit eb8d782
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Riot/Modules/Room/RoomViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -2690,7 +2690,7 @@ - (void)displayRoomPreview:(RoomPreviewData *)previewData
{
cellViewClass = RoomGroupCallStatusBubbleCell.class;
}
else if (bubbleData.attachment.type == MXKAttachmentTypeVoiceMessage)
else if (bubbleData.attachment.type == MXKAttachmentTypeVoiceMessage || bubbleData.attachment.type == MXKAttachmentTypeAudio)
{
if (bubbleData.isPaginationFirstBubble)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class VoiceMessageBubbleCell: SizableBaseBubbleCell, BubbleCellReactionsDisplaya
return
}

guard data.attachment.type == MXKAttachmentTypeVoiceMessage else {
guard data.attachment.type == MXKAttachmentTypeVoiceMessage || data.attachment.type == MXKAttachmentTypeAudio else {
fatalError("Invalid attachment type passed to a voice message cell.")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class VoiceMessageAttachmentCacheManager {
}

func loadAttachment(_ attachment: MXKAttachment, numberOfSamples: Int, completion: @escaping (Result<VoiceMessageAttachmentCacheManagerLoadResult, Error>) -> Void) {
guard attachment.type == MXKAttachmentTypeVoiceMessage else {
guard attachment.type == MXKAttachmentTypeVoiceMessage || attachment.type == MXKAttachmentTypeAudio else {
completion(Result.failure(VoiceMessageAttachmentCacheManagerError.invalidAttachmentType))
MXLog.error("[VoiceMessageAttachmentCacheManager] Invalid attachment type, ignoring request.")
return
Expand Down
1 change: 1 addition & 0 deletions changelog.d/4753.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Allow audio file attachments to be played back inline by reusing the existing voice message UI.

0 comments on commit eb8d782

Please sign in to comment.