Make in_reply_to in RelatesTo optional

This commit is contained in:
Jonas Platte 2020-07-27 21:30:51 +02:00
parent d5d2d1d893
commit 39c36176a6
No known key found for this signature in database
GPG Key ID: CC154DE0E30B7C67
2 changed files with 4 additions and 4 deletions

View File

@ -14,7 +14,7 @@ Breaking changes:
* Add PDU types: `pdu::{Pdu, PduStub}` * Add PDU types: `pdu::{Pdu, PduStub}`
* `presence::PresenceState` has been moved. Import it from `ruma` or `ruma-common`. * `presence::PresenceState` has been moved. Import it from `ruma` or `ruma-common`.
* `EventJson` has been moved and renamed. Import it from `ruma` or `ruma-common`. * `EventJson` has been moved and renamed. Import it from `ruma` or `ruma-common`.
* The `in_reply_to` field of `room::message::RelatesTo` is now optional
Improvements: Improvements:

View File

@ -381,7 +381,7 @@ pub struct VideoInfo {
pub struct RelatesTo { pub struct RelatesTo {
/// Information about another message being replied to. /// Information about another message being replied to.
#[serde(rename = "m.in_reply_to")] #[serde(rename = "m.in_reply_to")]
pub in_reply_to: InReplyTo, pub in_reply_to: Option<InReplyTo>,
} }
/// Information about the event a "rich reply" is replying to. /// Information about the event a "rich reply" is replying to.
@ -517,9 +517,9 @@ mod tests {
body: "> <@test:example.com> test\n\ntest reply".to_owned(), body: "> <@test:example.com> test\n\ntest reply".to_owned(),
formatted: None, formatted: None,
relates_to: Some(RelatesTo { relates_to: Some(RelatesTo {
in_reply_to: InReplyTo { in_reply_to: Some(InReplyTo {
event_id: EventId::try_from("$15827405538098VGFWH:example.com").unwrap(), event_id: EventId::try_from("$15827405538098VGFWH:example.com").unwrap(),
}, }),
}), }),
}); });