From 72f4c3cc535b3b89c96d0d7ce288b9b2ca165d72 Mon Sep 17 00:00:00 2001 From: timedout Date: Wed, 24 Jun 2026 20:26:31 +0100 Subject: [PATCH] chore: Remove unstable features that are now stable or abandoned --- src/api/client/admin/lock.rs | 22 ++++++++++++---------- src/api/client/admin/suspend.rs | 16 ++++++++-------- src/core/matrix/versions.rs | 14 -------------- 3 files changed, 20 insertions(+), 32 deletions(-) diff --git a/src/api/client/admin/lock.rs b/src/api/client/admin/lock.rs index b3cb25a0b..f748ef1ba 100644 --- a/src/api/client/admin/lock.rs +++ b/src/api/client/admin/lock.rs @@ -1,7 +1,7 @@ use axum::extract::State; use conduwuit::{Err, Result}; use futures::future::{join, join3}; -use ruminuwuity::admin::{get_suspended, set_suspended}; +use ruma::api::client::admin::{is_user_locked, lock_user}; use crate::Ruma; @@ -10,8 +10,8 @@ use crate::Ruma; /// Check the account lock status of a target user pub(crate) async fn get_lock_status( State(services): State, - body: Ruma, -) -> Result { + body: Ruma, +) -> Result { let (admin, active) = join( services.users.is_admin(body.identity.expect_sender_user()?), services.users.is_active(&body.user_id), @@ -26,7 +26,9 @@ pub(crate) async fn get_lock_status( if !active { return Err!(Request(NotFound("Unknown user"))); } - Ok(get_suspended::v1::Response::new(services.users.is_locked(&body.user_id).await?)) + Ok(is_user_locked::v1::Response::new( + services.users.is_locked(&body.user_id).await?, + )) } /// # `PUT /_matrix/client/v1/admin/lock/{userId}` @@ -34,8 +36,8 @@ pub(crate) async fn get_lock_status( /// Set the account lock status of a target user pub(crate) async fn put_lock_status( State(services): State, - body: Ruma, -) -> Result { + body: Ruma, +) -> Result { let sender_user = body.identity.expect_sender_user()?; let (sender_admin, active, target_admin) = join3( @@ -60,12 +62,12 @@ pub(crate) async fn put_lock_status( if target_admin { return Err!(Request(Forbidden("You cannot lock another server administrator"))); } - if services.users.is_locked(&body.user_id).await? == body.suspended { + if services.users.is_locked(&body.user_id).await? == body.locked { // No change - return Ok(set_suspended::v1::Response::new(body.suspended)); + return Ok(lock_user::v1::Response::new(body.locked)); } - let action = if body.suspended { + let action = if body.locked { services .users .suspend_account(&body.user_id, sender_user) @@ -84,5 +86,5 @@ pub(crate) async fn put_lock_status( .await; } - Ok(set_suspended::v1::Response::new(body.suspended)) + Ok(lock_user::v1::Response::new(body.locked)) } diff --git a/src/api/client/admin/suspend.rs b/src/api/client/admin/suspend.rs index 613d954a6..cf1beca8d 100644 --- a/src/api/client/admin/suspend.rs +++ b/src/api/client/admin/suspend.rs @@ -1,7 +1,7 @@ use axum::extract::State; use conduwuit::{Err, Result}; use futures::future::{join, join3}; -use ruminuwuity::admin::{get_suspended, set_suspended}; +use ruma::api::client::admin::{is_user_suspended, suspend_user}; use crate::Ruma; @@ -10,8 +10,8 @@ use crate::Ruma; /// Check the suspension status of a target user pub(crate) async fn get_suspended_status( State(services): State, - body: Ruma, -) -> Result { + body: Ruma, +) -> Result { let (admin, active) = join( services.users.is_admin(body.identity.expect_sender_user()?), services.users.is_active(&body.user_id), @@ -26,7 +26,7 @@ pub(crate) async fn get_suspended_status( if !active { return Err!(Request(NotFound("Unknown user"))); } - Ok(get_suspended::v1::Response::new( + Ok(is_user_suspended::v1::Response::new( services.users.is_suspended(&body.user_id).await?, )) } @@ -36,8 +36,8 @@ pub(crate) async fn get_suspended_status( /// Set the suspension status of a target user pub(crate) async fn put_suspended_status( State(services): State, - body: Ruma, -) -> Result { + body: Ruma, +) -> Result { let sender_user = body.identity.expect_sender_user()?; let (sender_admin, active, target_admin) = join3( @@ -64,7 +64,7 @@ pub(crate) async fn put_suspended_status( } if services.users.is_suspended(&body.user_id).await? == body.suspended { // No change - return Ok(set_suspended::v1::Response::new(body.suspended)); + return Ok(suspend_user::v1::Response::new(body.suspended)); } let action = if body.suspended { @@ -86,5 +86,5 @@ pub(crate) async fn put_suspended_status( .await; } - Ok(set_suspended::v1::Response::new(body.suspended)) + Ok(suspend_user::v1::Response::new(body.suspended)) } diff --git a/src/core/matrix/versions.rs b/src/core/matrix/versions.rs index 1b60b2a1e..bb9a31a0c 100644 --- a/src/core/matrix/versions.rs +++ b/src/core/matrix/versions.rs @@ -33,22 +33,8 @@ pub fn versions() -> Vec { #[must_use] pub fn unstable_features() -> BTreeMap { BTreeMap::from_iter([ - ("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) */ - ("uk.half-shot.msc2666.query_mutual_rooms".to_owned(), true), /* query mutual rooms (https://github.com/matrix-org/matrix-spec-proposals/pull/2666) */ - ("org.matrix.msc2836".to_owned(), true), /* threading/threads (https://github.com/matrix-org/matrix-spec-proposals/pull/2836) */ - ("org.matrix.msc2946".to_owned(), true), /* spaces/hierarchy summaries (https://github.com/matrix-org/matrix-spec-proposals/pull/2946) */ - ("org.matrix.msc3026.busy_presence".to_owned(), true), /* busy presence status (https://github.com/matrix-org/matrix-spec-proposals/pull/3026) */ - ("org.matrix.msc3827".to_owned(), true), /* filtering of /publicRooms by room type (https://github.com/matrix-org/matrix-spec-proposals/pull/3827) */ - ("org.matrix.msc3952_intentional_mentions".to_owned(), true), /* intentional mentions (https://github.com/matrix-org/matrix-spec-proposals/pull/3952) */ - ("org.matrix.msc3916.stable".to_owned(), true), /* authenticated media (https://github.com/matrix-org/matrix-spec-proposals/pull/3916) */ - ("org.matrix.msc4180".to_owned(), true), /* stable flag for 3916 (https://github.com/matrix-org/matrix-spec-proposals/pull/4180) */ - ("uk.tcpip.msc4133".to_owned(), true), /* Extending User Profile API with Key:Value Pairs (https://github.com/matrix-org/matrix-spec-proposals/pull/4133) */ - ("us.cloke.msc4175".to_owned(), true), /* Profile field for user time zone (https://github.com/matrix-org/matrix-spec-proposals/pull/4175) */ ("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) */ ("org.matrix.msc4155".to_owned(), true), /* invite filtering (https://github.com/matrix-org/matrix-spec-proposals/pull/4155) */ ("computer.gingershaped.msc4466".to_owned(), true), /* profile change propagation (https://github.com/matrix-org/matrix-spec-proposals/pull/4466) */ - ("org.matrix.msc4380.stable".to_owned(), true), ]) }