api: Add MatrixVersion::V1_3

This commit is contained in:
Kévin Commaille 2022-06-20 16:10:09 +02:00 committed by GitHub
parent cbad7fcb3a
commit a940de9e41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 1 deletions

View File

@ -27,6 +27,7 @@ Improvements:
* Add unstable support for polls (MSC3381)
* Add unstable support for Improved Signalling for 1:1 VoIP (MSC2746)
* Add support for knocking in `events::room::member::MembershipChange`
* Add `MatrixVersion::V1_3`
# 0.9.2

View File

@ -152,6 +152,11 @@ pub enum MatrixVersion {
///
/// See <https://spec.matrix.org/v1.2/>.
V1_2,
/// Version 1.3 of the Matrix specification, released in Q2 2022.
///
/// See <https://spec.matrix.org/v1.3/>.
V1_3,
}
impl TryFrom<&str> for MatrixVersion {
@ -167,6 +172,7 @@ impl TryFrom<&str> for MatrixVersion {
"r0.5.0" | "r0.6.0" | "r0.6.1" => V1_0,
"v1.1" => V1_1,
"v1.2" => V1_2,
"v1.3" => V1_3,
_ => return Err(UnknownVersionError),
})
}
@ -208,6 +214,7 @@ impl MatrixVersion {
MatrixVersion::V1_0 => (1, 0),
MatrixVersion::V1_1 => (1, 1),
MatrixVersion::V1_2 => (1, 2),
MatrixVersion::V1_3 => (1, 3),
}
}
@ -217,6 +224,7 @@ impl MatrixVersion {
(1, 0) => Ok(MatrixVersion::V1_0),
(1, 1) => Ok(MatrixVersion::V1_1),
(1, 2) => Ok(MatrixVersion::V1_2),
(1, 3) => Ok(MatrixVersion::V1_3),
_ => Err(UnknownVersionError),
}
}

View File

@ -10,7 +10,10 @@ pub(crate) fn check_spec_links(path: &Path) -> Result<()> {
println!("Checking Matrix Spec links are up-to-date...");
walk_dirs(path, "https://matrix.org/docs/spec/", |_| false)?;
walk_dirs(path, "https://spec.matrix.org/", |s| {
s.starts_with("v1.1") || s.starts_with("v1.2") || s.starts_with("unstable")
s.starts_with("v1.1")
|| s.starts_with("v1.2")
|| s.starts_with("v1.3")
|| s.starts_with("unstable")
})?;
Ok(())
}