diff --git a/crates/ruma-common/CHANGELOG.md b/crates/ruma-common/CHANGELOG.md index 81eda401..3bb3ac1c 100644 --- a/crates/ruma-common/CHANGELOG.md +++ b/crates/ruma-common/CHANGELOG.md @@ -28,6 +28,7 @@ Improvements: * Add unstable support for Improved Signalling for 1:1 VoIP (MSC2746) * Add support for knocking in `events::room::member::MembershipChange` * Add `MatrixVersion::V1_3` +* Deprecate the `sender_key` and `device_id` fields for encrypted events (MSC3700) # 0.9.2 diff --git a/crates/ruma-common/Cargo.toml b/crates/ruma-common/Cargo.toml index 58b00d33..6bcef7a7 100644 --- a/crates/ruma-common/Cargo.toml +++ b/crates/ruma-common/Cargo.toml @@ -47,7 +47,6 @@ unstable-msc3551 = ["unstable-msc1767"] unstable-msc3552 = ["unstable-msc3551"] unstable-msc3553 = ["unstable-msc3552"] unstable-msc3554 = ["unstable-msc1767"] -unstable-msc3700 = [] [dependencies] base64 = "0.13.0" diff --git a/crates/ruma-common/src/events/room/encrypted.rs b/crates/ruma-common/src/events/room/encrypted.rs index 16cc0f36..3fc136bf 100644 --- a/crates/ruma-common/src/events/room/encrypted.rs +++ b/crates/ruma-common/src/events/room/encrypted.rs @@ -264,17 +264,11 @@ pub struct MegolmV1AesSha2Content { pub ciphertext: String, /// The Curve25519 key of the sender. - #[cfg_attr( - feature = "unstable-msc3700", - deprecated = "this field still needs to be sent but should not be used when received" - )] + #[deprecated = "this field still needs to be sent but should not be used when received"] pub sender_key: String, /// The ID of the sending device. - #[cfg_attr( - feature = "unstable-msc3700", - deprecated = "this field still needs to be sent but should not be used when received" - )] + #[deprecated = "this field still needs to be sent but should not be used when received"] pub device_id: OwnedDeviceId, /// The ID of the session used to encrypt the message. @@ -317,7 +311,7 @@ mod tests { use serde_json::{from_value as from_json_value, json, to_value as to_json_value}; use super::{ - EncryptedEventScheme, InReplyTo, MegolmV1AesSha2Content, Relation, + EncryptedEventScheme, InReplyTo, MegolmV1AesSha2ContentInit, Relation, RoomEncryptedEventContent, }; use crate::{event_id, serde::Raw}; @@ -325,12 +319,15 @@ mod tests { #[test] fn serialization() { let key_verification_start_content = RoomEncryptedEventContent { - scheme: EncryptedEventScheme::MegolmV1AesSha2(MegolmV1AesSha2Content { - ciphertext: "ciphertext".into(), - sender_key: "sender_key".into(), - device_id: "device_id".into(), - session_id: "session_id".into(), - }), + scheme: EncryptedEventScheme::MegolmV1AesSha2( + MegolmV1AesSha2ContentInit { + ciphertext: "ciphertext".into(), + sender_key: "sender_key".into(), + device_id: "device_id".into(), + session_id: "session_id".into(), + } + .into(), + ), relates_to: Some(Relation::Reply { in_reply_to: InReplyTo { event_id: event_id!("$h29iv0s8:example.com").to_owned() }, }), @@ -353,6 +350,7 @@ mod tests { } #[test] + #[allow(deprecated)] fn deserialization() { let json_data = json!({ "algorithm": "m.megolm.v1.aes-sha2", diff --git a/crates/ruma-common/src/events/room_key_request.rs b/crates/ruma-common/src/events/room_key_request.rs index d31761ff..c07b1713 100644 --- a/crates/ruma-common/src/events/room_key_request.rs +++ b/crates/ruma-common/src/events/room_key_request.rs @@ -74,10 +74,7 @@ pub struct RequestedKeyInfo { pub room_id: OwnedRoomId, /// The Curve25519 key of the device which initiated the session originally. - #[cfg_attr( - feature = "unstable-msc3700", - deprecated = "this field still needs to be sent but should not be used when received" - )] + #[deprecated = "this field still needs to be sent but should not be used when received"] pub sender_key: String, /// The ID of the session that the key is for.