Skip to content

Commit

Permalink
fix(chat-message): clear message content for audio messages to preven…
Browse files Browse the repository at this point in the history
…t filename display (#2566)
  • Loading branch information
domw30 authored Jan 16, 2025
1 parent d3da66b commit 35d9720
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/lib/chat/matrix/chat-message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,14 @@ export async function mapMatrixMessage(matrixMessage, sdkMatrixClient: SDKMatrix
messageContent = parsePlainBody(content.body);
}

const message =
content.msgtype === MsgType.Image || content.msgtype === MsgType.Video || content.msgtype === MsgType.Audio
? ''
: messageContent;

return {
id: event_id,
message: content.msgtype === MsgType.Image || content.msgtype === MsgType.Video ? '' : messageContent,
message,
createdAt: origin_server_ts,
updatedAt: updatedAt,
sender: {
Expand Down

0 comments on commit 35d9720

Please sign in to comment.