Verified Commit 8bf85c11 authored by M. Sandoval's avatar M. Sandoval 🥑
Browse files

Message Widget: Do not render incomplete messages

If a message contains raw html, the formatted body will contain a
comment, and instead of showing an incomplete message, the plain text
message is used.
parent 735ca936
......@@ -523,6 +523,12 @@ fn build_room_msg(
fn build_room_msg_body_html(container: &MessageBoxContainer, msg: &Message) -> anyhow::Result<gtk::Box> {
let raw = msg.msg.formatted_body.clone().unwrap_or_default();
if raw.contains("<!-- raw HTML omitted -->") {
anyhow::bail!(
"Empty message omited: <!-- raw HTML omitted -->, using plain text instead."
);
}
let blocks =
markup_html(&raw).with_context(|| format!("Could not render message: {}", &raw))?;
let bx = gtk::Box::new(gtk::Orientation::Vertical, 6);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment