events: Add support for formatted body on KeyVerificationRequestEventContent
This commit is contained in:
		
							parent
							
								
									583ee2cdfa
								
							
						
					
					
						commit
						74161014be
					
				| @ -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 | ||||
| 
 | ||||
|  | ||||
| @ -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<FormattedBody>, | ||||
| 
 | ||||
|     /// The verification methods supported by the sender.
 | ||||
|     pub methods: Vec<VerificationMethod>, | ||||
| 
 | ||||
| @ -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 } | ||||
|     } | ||||
| } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user