From 56b400b832c420c42efd8641f63fa34c01a5e967 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Mon, 7 Oct 2024 22:25:26 +0200 Subject: [PATCH] api: Add MatrixVersion::V1_12 --- crates/ruma-common/CHANGELOG.md | 2 +- crates/ruma-common/src/api/metadata.rs | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/crates/ruma-common/CHANGELOG.md b/crates/ruma-common/CHANGELOG.md index 82e5c153..12999062 100644 --- a/crates/ruma-common/CHANGELOG.md +++ b/crates/ruma-common/CHANGELOG.md @@ -22,7 +22,7 @@ Improvements: cases where we receive a HTTP header with an unexpected value. - Implement `Eq`/`Hash`/`PartialEq` for `ThirdPartyIdentifier`, to check whether a `ThirdPartyIdentifier` has already been added by another user. -- Add `MatrixVersion::V1_11` +- Add `MatrixVersion::V1_11` and `MatrixVersion::V1_12`. - Clarify in the docs of `AuthScheme` that sending an access token via a query parameter is deprecated, according to MSC4126 / Matrix 1.11. - Constructing a Matrix URI for an event with a room alias is deprecated, diff --git a/crates/ruma-common/src/api/metadata.rs b/crates/ruma-common/src/api/metadata.rs index 70f208be..8f8a8823 100644 --- a/crates/ruma-common/src/api/metadata.rs +++ b/crates/ruma-common/src/api/metadata.rs @@ -548,6 +548,11 @@ pub enum MatrixVersion { /// /// See . V1_11, + + /// Version 1.12 of the Matrix specification, released in Q3 2024. + /// + /// See . + V1_12, } impl TryFrom<&str> for MatrixVersion { @@ -572,6 +577,7 @@ impl TryFrom<&str> for MatrixVersion { "v1.9" => V1_9, "v1.10" => V1_10, "v1.11" => V1_11, + "v1.12" => V1_12, _ => return Err(UnknownVersionError), }) } @@ -622,6 +628,7 @@ impl MatrixVersion { MatrixVersion::V1_9 => (1, 9), MatrixVersion::V1_10 => (1, 10), MatrixVersion::V1_11 => (1, 11), + MatrixVersion::V1_12 => (1, 12), } } @@ -640,6 +647,7 @@ impl MatrixVersion { (1, 9) => Ok(MatrixVersion::V1_9), (1, 10) => Ok(MatrixVersion::V1_10), (1, 11) => Ok(MatrixVersion::V1_11), + (1, 12) => Ok(MatrixVersion::V1_12), _ => Err(UnknownVersionError), } } @@ -736,7 +744,9 @@ impl MatrixVersion { // | MatrixVersion::V1_10 // - | MatrixVersion::V1_11 => RoomVersionId::V10, + | MatrixVersion::V1_11 + // + | MatrixVersion::V1_12 => RoomVersionId::V10, } } }