From 4f8bcf3ee12be4c0ef3e952b03b809a2d3db72d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Tue, 14 Feb 2023 18:15:08 +0100 Subject: [PATCH] common: Add MatrixVersion::V1_6 --- crates/ruma-common/CHANGELOG.md | 4 ++++ crates/ruma-common/src/api/metadata.rs | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/crates/ruma-common/CHANGELOG.md b/crates/ruma-common/CHANGELOG.md index c40697d9..0a13ee0c 100644 --- a/crates/ruma-common/CHANGELOG.md +++ b/crates/ruma-common/CHANGELOG.md @@ -1,5 +1,9 @@ # [unreleased] +Improvements: + +* Add `MatrixVersion::V1_6` + # 0.11.2 Bug fixes: diff --git a/crates/ruma-common/src/api/metadata.rs b/crates/ruma-common/src/api/metadata.rs index ef112614..606988a1 100644 --- a/crates/ruma-common/src/api/metadata.rs +++ b/crates/ruma-common/src/api/metadata.rs @@ -505,6 +505,11 @@ pub enum MatrixVersion { /// /// See . V1_5, + + /// Version 1.6 of the Matrix specification, released in Q1 2023. + /// + /// See . + V1_6, } impl TryFrom<&str> for MatrixVersion { @@ -523,6 +528,7 @@ impl TryFrom<&str> for MatrixVersion { "v1.3" => V1_3, "v1.4" => V1_4, "v1.5" => V1_5, + "v1.6" => V1_6, _ => return Err(UnknownVersionError), }) } @@ -567,6 +573,7 @@ impl MatrixVersion { MatrixVersion::V1_3 => (1, 3), MatrixVersion::V1_4 => (1, 4), MatrixVersion::V1_5 => (1, 5), + MatrixVersion::V1_6 => (1, 6), } } @@ -579,6 +586,7 @@ impl MatrixVersion { (1, 3) => Ok(MatrixVersion::V1_3), (1, 4) => Ok(MatrixVersion::V1_4), (1, 5) => Ok(MatrixVersion::V1_5), + (1, 6) => Ok(MatrixVersion::V1_6), _ => Err(UnknownVersionError), } } @@ -655,6 +663,8 @@ impl MatrixVersion { | MatrixVersion::V1_4 // | MatrixVersion::V1_5 => RoomVersionId::V9, + // + MatrixVersion::V1_6 => RoomVersionId::V10, } } }