mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
refactor: Fix errors in api/client/unversioned.rs
This commit is contained in:
@@ -3,7 +3,7 @@ use std::collections::BTreeMap;
|
|||||||
use axum::{Json, extract::State, response::IntoResponse};
|
use axum::{Json, extract::State, response::IntoResponse};
|
||||||
use conduwuit::Result;
|
use conduwuit::Result;
|
||||||
use futures::StreamExt;
|
use futures::StreamExt;
|
||||||
use ruma::api::client::discovery::get_supported_versions;
|
use ruma::{api::client::discovery::get_supported_versions, assign};
|
||||||
|
|
||||||
use crate::Ruma;
|
use crate::Ruma;
|
||||||
|
|
||||||
@@ -22,8 +22,7 @@ use crate::Ruma;
|
|||||||
pub(crate) async fn get_supported_versions_route(
|
pub(crate) async fn get_supported_versions_route(
|
||||||
_body: Ruma<get_supported_versions::Request>,
|
_body: Ruma<get_supported_versions::Request>,
|
||||||
) -> Result<get_supported_versions::Response> {
|
) -> Result<get_supported_versions::Response> {
|
||||||
let resp = get_supported_versions::Response {
|
let versions = vec![
|
||||||
versions: vec![
|
|
||||||
"r0.0.1".to_owned(),
|
"r0.0.1".to_owned(),
|
||||||
"r0.1.0".to_owned(),
|
"r0.1.0".to_owned(),
|
||||||
"r0.2.0".to_owned(),
|
"r0.2.0".to_owned(),
|
||||||
@@ -42,8 +41,9 @@ pub(crate) async fn get_supported_versions_route(
|
|||||||
"v1.12".to_owned(),
|
"v1.12".to_owned(),
|
||||||
"v1.13".to_owned(),
|
"v1.13".to_owned(),
|
||||||
"v1.14".to_owned(),
|
"v1.14".to_owned(),
|
||||||
],
|
];
|
||||||
unstable_features: BTreeMap::from_iter([
|
|
||||||
|
let unstable_features = BTreeMap::from_iter([
|
||||||
("org.matrix.e2e_cross_signing".to_owned(), true),
|
("org.matrix.e2e_cross_signing".to_owned(), true),
|
||||||
("org.matrix.msc2285.stable".to_owned(), true), /* private read receipts (https://github.com/matrix-org/matrix-spec-proposals/pull/2285) */
|
("org.matrix.msc2285.stable".to_owned(), true), /* private read receipts (https://github.com/matrix-org/matrix-spec-proposals/pull/2285) */
|
||||||
("uk.half-shot.msc2666.query_mutual_rooms".to_owned(), true), /* query mutual rooms (https://github.com/matrix-org/matrix-spec-proposals/pull/2666) */
|
("uk.half-shot.msc2666.query_mutual_rooms".to_owned(), true), /* query mutual rooms (https://github.com/matrix-org/matrix-spec-proposals/pull/2666) */
|
||||||
@@ -60,10 +60,9 @@ pub(crate) async fn get_supported_versions_route(
|
|||||||
("org.matrix.simplified_msc3575".to_owned(), true), /* Simplified Sliding sync (https://github.com/matrix-org/matrix-spec-proposals/pull/4186) */
|
("org.matrix.simplified_msc3575".to_owned(), true), /* Simplified Sliding sync (https://github.com/matrix-org/matrix-spec-proposals/pull/4186) */
|
||||||
("uk.timedout.msc4323".to_owned(), true), /* agnostic suspend (https://github.com/matrix-org/matrix-spec-proposals/pull/4323) */
|
("uk.timedout.msc4323".to_owned(), true), /* agnostic suspend (https://github.com/matrix-org/matrix-spec-proposals/pull/4323) */
|
||||||
("org.matrix.msc4155".to_owned(), true), /* invite filtering (https://github.com/matrix-org/matrix-spec-proposals/pull/4155) */
|
("org.matrix.msc4155".to_owned(), true), /* invite filtering (https://github.com/matrix-org/matrix-spec-proposals/pull/4155) */
|
||||||
]),
|
]);
|
||||||
};
|
|
||||||
|
|
||||||
Ok(resp)
|
Ok(assign!(get_supported_versions::Response::new(versions), { unstable_features }))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// # `GET /_conduwuit/server_version`
|
/// # `GET /_conduwuit/server_version`
|
||||||
|
|||||||
@@ -13,7 +13,11 @@ use conduwuit_core::{
|
|||||||
};
|
};
|
||||||
use futures::{StreamExt, TryStreamExt, future, future::ready};
|
use futures::{StreamExt, TryStreamExt, future, future::ready};
|
||||||
use ruma::{
|
use ruma::{
|
||||||
CanonicalJsonObject, CanonicalJsonValue, OwnedEventId, OwnedRoomId, RoomId, RoomVersionId, UserId, events::{StateEventType, TimelineEventType, room::create::RoomCreateEventContent}, room_version_rules::RoomVersionRules, uint
|
CanonicalJsonObject, CanonicalJsonValue, OwnedEventId, OwnedRoomId, RoomId, RoomVersionId,
|
||||||
|
UserId,
|
||||||
|
events::{StateEventType, TimelineEventType, room::create::RoomCreateEventContent},
|
||||||
|
room_version_rules::RoomVersionRules,
|
||||||
|
uint,
|
||||||
};
|
};
|
||||||
use serde_json::value::{RawValue, to_raw_value};
|
use serde_json::value::{RawValue, to_raw_value};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user