events: Add From<MessageType> for RoomMessageEventContentWithoutRelation

This commit is contained in:
Jonas Platte 2023-07-12 11:58:22 +02:00
parent 9cf1257142
commit 20d38e1622
No known key found for this signature in database
GPG Key ID: AAA7A61F696C3E0C

View File

@ -442,6 +442,12 @@ impl RoomMessageEventContentWithoutRelation {
}
}
impl From<MessageType> for RoomMessageEventContentWithoutRelation {
fn from(msgtype: MessageType) -> Self {
Self::new(msgtype)
}
}
impl From<RoomMessageEventContent> for RoomMessageEventContentWithoutRelation {
fn from(value: RoomMessageEventContent) -> Self {
let RoomMessageEventContent { msgtype, mentions, .. } = value;