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

26 lines
1,018 B
Rust
Raw Normal View History

2022-01-13 12:06:20 +01:00
use std::{collections::BTreeMap, iter::FromIterator};
use crate::{Result, Ruma};
2022-02-18 15:33:14 +01:00
use ruma::api::client::discover::get_supported_versions;
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(
_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()],
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
}