2026-02-13 23:58:24 +00:00
|
|
|
use std::iter::once;
|
2022-01-13 12:06:20 +01:00
|
|
|
|
2024-11-24 00:19:55 +00:00
|
|
|
use ruma::api::client::discovery::get_supported_versions;
|
2025-04-22 01:41:02 +00:00
|
|
|
use tuwunel_core::Result;
|
2022-04-06 21:31:29 +02:00
|
|
|
|
2025-04-04 03:30:13 +00:00
|
|
|
use crate::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
|
2024-04-22 23:48:57 -04:00
|
|
|
pub(crate) async fn get_supported_versions_route(
|
2022-12-14 13:09:10 +01:00
|
|
|
_body: Ruma<get_supported_versions::Request>,
|
2022-01-22 16:58:32 +01:00
|
|
|
) -> Result<get_supported_versions::Response> {
|
2026-02-13 23:58:24 +00:00
|
|
|
Ok(get_supported_versions::Response {
|
|
|
|
|
versions: VERSIONS.into_iter().map(Into::into).collect(),
|
2020-07-30 18:14:47 +02:00
|
|
|
|
2026-02-13 23:58:24 +00:00
|
|
|
unstable_features: UNSTABLE_FEATURES
|
|
|
|
|
.into_iter()
|
|
|
|
|
.map(Into::into)
|
|
|
|
|
.zip(once(true).cycle())
|
|
|
|
|
.collect(),
|
|
|
|
|
})
|
2020-07-30 18:14:47 +02:00
|
|
|
}
|
2026-02-13 23:58:24 +00:00
|
|
|
|
|
|
|
|
static VERSIONS: [&str; 17] = [
|
|
|
|
|
"r0.0.1", /* Historical */
|
|
|
|
|
"r0.1.0", /* Historical */
|
|
|
|
|
"r0.2.0", /* Historical */
|
|
|
|
|
"r0.3.0", /* Historical */
|
|
|
|
|
"r0.4.0", /* Historical */
|
|
|
|
|
"r0.5.0", /* Historical */
|
|
|
|
|
"r0.6.0", /* Historical */
|
|
|
|
|
"r0.6.1", /* Historical */
|
|
|
|
|
"v1.1", /* Stable; Tested */
|
|
|
|
|
"v1.2", /* Stable; Tested */
|
|
|
|
|
"v1.3", /* Stable; Tested */
|
|
|
|
|
"v1.4", /* Stable; Tested */
|
|
|
|
|
"v1.5", /* Stable; Tested */
|
|
|
|
|
"v1.10", /* Tested; relations recursion */
|
|
|
|
|
"v1.11", /* Tested; authenticated media */
|
|
|
|
|
"v1.12", /* m.tz */
|
|
|
|
|
"v1.15", /* custom profile fields */
|
|
|
|
|
];
|
|
|
|
|
|
2026-02-22 12:58:01 +05:00
|
|
|
static UNSTABLE_FEATURES: [&str; 22] = [
|
2026-02-13 23:58:24 +00:00
|
|
|
"org.matrix.e2e_cross_signing",
|
|
|
|
|
// private read receipts (https://github.com/matrix-org/matrix-spec-proposals/pull/2285)
|
|
|
|
|
"org.matrix.msc2285.stable",
|
|
|
|
|
// appservice ping https://github.com/matrix-org/matrix-spec-proposals/pull/2659)
|
|
|
|
|
"fi.mau.msc2659.stable",
|
|
|
|
|
// query mutual rooms (https://github.com/matrix-org/matrix-spec-proposals/pull/2666)
|
|
|
|
|
"uk.half-shot.msc2666.query_mutual_rooms",
|
|
|
|
|
// threading/threads (https://github.com/matrix-org/matrix-spec-proposals/pull/2836)
|
|
|
|
|
"org.matrix.msc2836",
|
|
|
|
|
// spaces/hierarchy summaries (https://github.com/matrix-org/matrix-spec-proposals/pull/2946)
|
|
|
|
|
"org.matrix.msc2946",
|
|
|
|
|
// busy presence status (https://github.com/matrix-org/matrix-spec-proposals/pull/3026)
|
|
|
|
|
"org.matrix.msc3026.busy_presence",
|
|
|
|
|
// sliding sync (https://github.com/matrix-org/matrix-spec-proposals/pull/3575/files#r1588877046)
|
|
|
|
|
"org.matrix.msc3575",
|
|
|
|
|
// dehydrated devices
|
|
|
|
|
"org.matrix.msc3814",
|
|
|
|
|
// filtering of /publicRooms by room type (https://github.com/matrix-org/matrix-spec-proposals/pull/3827)
|
|
|
|
|
"org.matrix.msc3827",
|
2026-02-15 06:34:41 +05:00
|
|
|
"org.matrix.msc3827.stable",
|
2026-02-13 23:58:24 +00:00
|
|
|
// authenticated media (https://github.com/matrix-org/matrix-spec-proposals/pull/3916)
|
|
|
|
|
"org.matrix.msc3916.stable",
|
|
|
|
|
// intentional mentions (https://github.com/matrix-org/matrix-spec-proposals/pull/3952)
|
|
|
|
|
"org.matrix.msc3952_intentional_mentions",
|
|
|
|
|
// Extending User Profile API with Key:Value Pairs (https://github.com/matrix-org/matrix-spec-proposals/pull/4133)
|
|
|
|
|
"uk.tcpip.msc4133",
|
|
|
|
|
// Profile field for user time zone (https://github.com/matrix-org/matrix-spec-proposals/pull/4175)
|
|
|
|
|
"us.cloke.msc4175",
|
|
|
|
|
// stable flag for 3916 (https://github.com/matrix-org/matrix-spec-proposals/pull/4180)
|
|
|
|
|
"org.matrix.msc4180",
|
|
|
|
|
// Simplified Sliding sync (https://github.com/matrix-org/matrix-spec-proposals/pull/4186)
|
|
|
|
|
"org.matrix.simplified_msc3575",
|
|
|
|
|
// Allow room moderators to view redacted event content (https://github.com/matrix-org/matrix-spec-proposals/pull/2815)
|
|
|
|
|
"fi.mau.msc2815",
|
2026-02-22 12:58:01 +05:00
|
|
|
// OIDC-native auth: authorization code grant (https://github.com/matrix-org/matrix-spec-proposals/pull/2964)
|
|
|
|
|
"org.matrix.msc2964",
|
|
|
|
|
// OIDC-native auth: auth issuer discovery (https://github.com/matrix-org/matrix-spec-proposals/pull/2965)
|
|
|
|
|
"org.matrix.msc2965",
|
|
|
|
|
// OIDC-native auth: dynamic client registration (https://github.com/matrix-org/matrix-spec-proposals/pull/2966)
|
|
|
|
|
"org.matrix.msc2966",
|
|
|
|
|
// OIDC-native auth: API scopes (https://github.com/matrix-org/matrix-spec-proposals/pull/2967)
|
|
|
|
|
"org.matrix.msc2967",
|
2026-02-13 23:58:24 +00:00
|
|
|
];
|