1
0
Fork 0
mirror of https://gitlab.com/famedly/conduit.git synced 2025-06-27 16:35:59 +00:00
conduit/src/api/client_server/unversioned.rs

32 lines
1.1 KiB
Rust
Raw Normal View History

2022-01-13 12:06:20 +01:00
use std::{collections::BTreeMap, iter::FromIterator};
2022-04-06 21:31:29 +02:00
use ruma::api::client::discovery::get_supported_versions;
use crate::{Result, Ruma};
2020-07-30 18:14:47 +02:00
2020-07-31 14:40:28 +02:00
/// # `GET /_matrix/client/versions`
///
/// Get the versions of the specification and unstable features supported by this server.
///
/// - Versions take the form MAJOR.MINOR.PATCH
/// - Only the latest PATCH release will be reported for each MAJOR.MINOR value
2021-08-31 19:14:37 +02:00
/// - Unstable features are namespaced and may include version information in their name
2020-07-31 14:40:28 +02:00
///
/// Note: Unstable features are used while developing new features. Clients should avoid using
/// unstable features in their stable releases
2022-01-20 11:51:31 +01:00
pub async fn get_supported_versions_route(
2022-12-14 13:09:10 +01:00
_body: Ruma<get_supported_versions::Request>,
) -> Result<get_supported_versions::Response> {
2022-01-13 11:48:18 +01:00
let resp = get_supported_versions::Response {
versions: vec![
"r0.5.0".to_owned(),
"r0.6.0".to_owned(),
"v1.1".to_owned(),
"v1.2".to_owned(),
],
2022-01-13 12:06:20 +01:00
unstable_features: BTreeMap::from_iter([("org.matrix.e2e_cross_signing".to_owned(), true)]),
2022-01-13 11:48:18 +01:00
};
2020-07-30 18:14:47 +02:00
Ok(resp)
2020-07-30 18:14:47 +02:00
}