From ac2f725bcc90ff95a2be86a22e755034db348776 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Thu, 30 Nov 2023 14:17:58 +0100 Subject: [PATCH] api: Add support for Matrix 1.9 --- crates/ruma-common/CHANGELOG.md | 3 +++ crates/ruma-common/src/api/metadata.rs | 12 +++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/crates/ruma-common/CHANGELOG.md b/crates/ruma-common/CHANGELOG.md index 692f4737..19638a1c 100644 --- a/crates/ruma-common/CHANGELOG.md +++ b/crates/ruma-common/CHANGELOG.md @@ -1,6 +1,9 @@ # [unreleased] +Improvements: + - Stabilize support for `.m.rule.suppress_edits` push rule (MSC3958 / Matrix 1.9) +- Add `MatrixVersion::V1_9` # 0.12.1 diff --git a/crates/ruma-common/src/api/metadata.rs b/crates/ruma-common/src/api/metadata.rs index 63588ef2..f26c8f86 100644 --- a/crates/ruma-common/src/api/metadata.rs +++ b/crates/ruma-common/src/api/metadata.rs @@ -521,6 +521,11 @@ pub enum MatrixVersion { /// /// See . V1_8, + + /// Version 1.9 of the Matrix specification, released in Q4 2023. + /// + /// See . + V1_9, } impl TryFrom<&str> for MatrixVersion { @@ -542,6 +547,7 @@ impl TryFrom<&str> for MatrixVersion { "v1.6" => V1_6, "v1.7" => V1_7, "v1.8" => V1_8, + "v1.9" => V1_9, _ => return Err(UnknownVersionError), }) } @@ -589,6 +595,7 @@ impl MatrixVersion { MatrixVersion::V1_6 => (1, 6), MatrixVersion::V1_7 => (1, 7), MatrixVersion::V1_8 => (1, 8), + MatrixVersion::V1_9 => (1, 9), } } @@ -604,6 +611,7 @@ impl MatrixVersion { (1, 6) => Ok(MatrixVersion::V1_6), (1, 7) => Ok(MatrixVersion::V1_7), (1, 8) => Ok(MatrixVersion::V1_8), + (1, 9) => Ok(MatrixVersion::V1_9), _ => Err(UnknownVersionError), } } @@ -694,7 +702,9 @@ impl MatrixVersion { // | MatrixVersion::V1_7 // - | MatrixVersion::V1_8 => RoomVersionId::V10, + | MatrixVersion::V1_8 + // + | MatrixVersion::V1_9 => RoomVersionId::V10, } } }