diff --git a/ruma-events/src/room/message.rs b/ruma-events/src/room/message.rs index 1f35f585..a28ba635 100644 --- a/ruma-events/src/room/message.rs +++ b/ruma-events/src/room/message.rs @@ -292,6 +292,13 @@ pub struct FormattedBody { pub body: String, } +impl FormattedBody { + /// Creates a new HTML-formatted message body. + pub fn html(body: String) -> Self { + Self { format: MessageFormat::Html, body } + } +} + /// The payload for a text message. #[derive(Clone, Debug, Deserialize, Serialize)] pub struct TextMessageEventContent {