From ccf3af21f9bde550ab1d60765cf93dd6c2554d66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Wed, 18 Aug 2021 09:28:44 +0200 Subject: [PATCH] Allow playback of replied-to voice message MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- src/components/views/rooms/ReplyTile.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/views/rooms/ReplyTile.tsx b/src/components/views/rooms/ReplyTile.tsx index 8c0e09c76c..741a7ac5ef 100644 --- a/src/components/views/rooms/ReplyTile.tsx +++ b/src/components/views/rooms/ReplyTile.tsx @@ -25,8 +25,9 @@ import MImageReplyBody from "../messages/MImageReplyBody"; import * as sdk from '../../../index'; import { EventType, MsgType } from 'matrix-js-sdk/src/@types/event'; import { replaceableComponent } from '../../../utils/replaceableComponent'; -import { getEventDisplayInfo } from '../../../utils/EventUtils'; +import { getEventDisplayInfo, isVoiceMessage } from '../../../utils/EventUtils'; import MFileBody from "../messages/MFileBody"; +import MVoiceMessageBody from "../messages/MVoiceMessageBody"; interface IProps { mxEvent: MatrixEvent; @@ -137,7 +138,7 @@ export default class ReplyTile extends React.PureComponent { const msgtypeOverrides = { [MsgType.Image]: MImageReplyBody, // Override audio and video body with file body. We also hide the download/decrypt button using CSS - [MsgType.Audio]: MFileBody, + [MsgType.Audio]: isVoiceMessage(mxEvent) ? MVoiceMessageBody : MFileBody, [MsgType.Video]: MFileBody, }; const evOverrides = {