events: Add accessor methods for RoomMessageEventContent
This commit is contained in:
parent
897146e369
commit
1e9f846722
@ -16,6 +16,7 @@ Improvements:
|
||||
|
||||
* Add `room::message::MessageType::body` accessor method
|
||||
* Implement `Redact` for event structs (in addition to `Any` event enums)
|
||||
* Add `room::message::RoomMessageEventContent::{body, msgtype}` accessor methods
|
||||
|
||||
# 0.24.6
|
||||
|
||||
|
@ -164,6 +164,19 @@ impl RoomMessageEventContent {
|
||||
..Self::notice_html(body, html_body)
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns a reference to the `msgtype` string.
|
||||
///
|
||||
/// If you want to access the message type-specific data rather than the message type itself,
|
||||
/// use the `msgtype` *field*, not this method.
|
||||
pub fn msgtype(&self) -> &str {
|
||||
self.msgtype.msgtype()
|
||||
}
|
||||
|
||||
/// Return a reference to the message body.
|
||||
pub fn body(&self) -> &str {
|
||||
self.msgtype.body()
|
||||
}
|
||||
}
|
||||
|
||||
/// The content that is specific to each message type variant.
|
||||
|
Loading…
x
Reference in New Issue
Block a user