Skip to content

Commit

Permalink
fix(media): include the formatted caption and filename for audio and …
Browse files Browse the repository at this point in the history
…file attachments too
  • Loading branch information
bnjbvr committed Nov 19, 2024
1 parent 0b16d48 commit d24d381
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions crates/matrix-sdk/src/room/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2076,7 +2076,10 @@ impl Room {
}

mime::AUDIO => {
let mut content = AudioMessageEventContent::new(body, source);
let mut content = assign!(AudioMessageEventContent::new(body, source), {
formatted: formatted_caption,
filename
});

if let Some(AttachmentInfo::Voice { audio_info, waveform: Some(waveform_vec) }) =
&info
Expand Down Expand Up @@ -2117,7 +2120,9 @@ impl Room {
thumbnail_info
});
let content = assign!(FileMessageEventContent::new(body, source), {
info: Some(Box::new(info))
info: Some(Box::new(info)),
formatted: formatted_caption,
filename,
});
MessageType::File(content)
}
Expand Down

0 comments on commit d24d381

Please sign in to comment.