Add NoticeMessageEventContent::html and TextMessageEventContent::html
This commit is contained in:
parent
4a5272e37b
commit
d36dcdb202
@ -232,6 +232,15 @@ impl NoticeMessageEventContent {
|
|||||||
pub fn plain(body: impl Into<String>) -> Self {
|
pub fn plain(body: impl Into<String>) -> Self {
|
||||||
Self { body: body.into(), formatted: None, relates_to: None }
|
Self { body: body.into(), formatted: None, relates_to: None }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// A convenience constructor to create an html notice.
|
||||||
|
pub fn html(body: impl Into<String>, html_body: impl Into<String>) -> Self {
|
||||||
|
Self {
|
||||||
|
body: body.into(),
|
||||||
|
formatted: Some(FormattedBody::html(html_body)),
|
||||||
|
relates_to: None,
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The payload for a server notice message.
|
/// The payload for a server notice message.
|
||||||
@ -339,6 +348,15 @@ impl TextMessageEventContent {
|
|||||||
Self { body: body.into(), formatted: None, relates_to: None }
|
Self { body: body.into(), formatted: None, relates_to: None }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// A convenience constructor to create an html message.
|
||||||
|
pub fn html(body: impl Into<String>, html_body: impl Into<String>) -> Self {
|
||||||
|
Self {
|
||||||
|
body: body.into(),
|
||||||
|
formatted: Some(FormattedBody::html(html_body)),
|
||||||
|
relates_to: None,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// A convenience constructor to create a plain text message.
|
/// A convenience constructor to create a plain text message.
|
||||||
#[deprecated = "Renamed to plain"]
|
#[deprecated = "Renamed to plain"]
|
||||||
pub fn new_plain(body: impl Into<String>) -> Self {
|
pub fn new_plain(body: impl Into<String>) -> Self {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user