diff --git a/ruma-events/src/room/message.rs b/ruma-events/src/room/message.rs index 9d120bb8..a505eefb 100644 --- a/ruma-events/src/room/message.rs +++ b/ruma-events/src/room/message.rs @@ -322,11 +322,7 @@ impl NoticeMessageEventContent { /// A convenience constructor to create an html notice. pub fn html(body: impl Into, html_body: impl Into) -> Self { - Self { - body: body.into(), - formatted: Some(FormattedBody::html(html_body)), - relates_to: None, - } + Self { formatted: Some(FormattedBody::html(html_body)), ..Self::plain(body) } } } @@ -443,11 +439,7 @@ impl TextMessageEventContent { /// A convenience constructor to create an html message. pub fn html(body: impl Into, html_body: impl Into) -> Self { - Self { - body: body.into(), - formatted: Some(FormattedBody::html(html_body)), - relates_to: None, - } + Self { formatted: Some(FormattedBody::html(html_body)), ..Self::plain(body) } } /// A convenience constructor to create a plain text message.