Fall back to showing body for unknown message types (#496)

This commit is contained in:
vaw
2025-09-03 05:02:21 +00:00
committed by GitHub
parent 6ebb7ac7fd
commit 745f547904

View File

@@ -573,20 +573,7 @@ fn body_cow_content(content: &RoomMessageEventContent) -> Cow<'_, str> {
MessageType::Video(content) => { MessageType::Video(content) => {
display_file_to_text!(Video, content); display_file_to_text!(Video, content);
}, },
_ => { _ => content.body(),
match content.msgtype() {
// Just show the body text for the special Element messages.
"nic.custom.confetti" |
"nic.custom.fireworks" |
"io.element.effect.hearts" |
"io.element.effect.rainfall" |
"io.element.effect.snowfall" |
"io.element.effects.space_invaders" => content.body(),
other => {
return Cow::Owned(format!("[Unknown message type: {other:?}]"));
},
}
},
}; };
Cow::Borrowed(s) Cow::Borrowed(s)