Add a convenience constructor to FormattedBody

This commit is contained in:
Jonas Platte 2020-07-25 01:44:06 +02:00
parent c8b1aad189
commit 76c2f5c449
No known key found for this signature in database
GPG Key ID: 7D261D771D915378

View File

@ -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 {