diff --git a/crates/ruma-common/CHANGELOG.md b/crates/ruma-common/CHANGELOG.md index d0455a9d..85085c46 100644 --- a/crates/ruma-common/CHANGELOG.md +++ b/crates/ruma-common/CHANGELOG.md @@ -51,6 +51,7 @@ Improvements: * `Ruleset::set_enabled` to change the enabled state of push rules * `Ruleset::set_actions` to change the actions of push rules * Add support for bundled reference relations (MSC3267 / Matrix 1.5) +* Add the `formatted` field on `KeyVerificationRequestEventContent` (Matrix 1.5) # 0.10.5 diff --git a/crates/ruma-common/src/events/room/message/key_verification_request.rs b/crates/ruma-common/src/events/room/message/key_verification_request.rs index b2c65aa0..ebdabd74 100644 --- a/crates/ruma-common/src/events/room/message/key_verification_request.rs +++ b/crates/ruma-common/src/events/room/message/key_verification_request.rs @@ -1,5 +1,6 @@ use serde::{Deserialize, Serialize}; +use super::FormattedBody; use crate::{events::key::verification::VerificationMethod, OwnedDeviceId, OwnedUserId}; /// The payload for a key verification request message. @@ -9,8 +10,19 @@ use crate::{events::key::verification::VerificationMethod, OwnedDeviceId, OwnedU pub struct KeyVerificationRequestEventContent { /// A fallback message to alert users that their client does not support the key verification /// framework. + /// + /// Clients that do support the key verification framework should hide the body and instead + /// present the user with an interface to accept or reject the key verification. pub body: String, + /// Formatted form of the `body`. + /// + /// As with the `body`, clients that do support the key verification framework should hide the + /// formatted body and instead present the user with an interface to accept or reject the key + /// verification. + #[serde(flatten)] + pub formatted: Option, + /// The verification methods supported by the sender. pub methods: Vec, @@ -34,6 +46,6 @@ impl KeyVerificationRequestEventContent { from_device: OwnedDeviceId, to: OwnedUserId, ) -> Self { - Self { body, methods, from_device, to } + Self { body, formatted: None, methods, from_device, to } } }