style(MSC4323): Satisfy our linting overlords

This commit is contained in:
nexy7574 2025-08-31 17:10:56 +01:00
commit 04e796176a
No known key found for this signature in database
2 changed files with 8 additions and 8 deletions

View file

@ -14,10 +14,10 @@ pub(crate) async fn get_suspended_status(
let sender_user = body.sender_user(); let sender_user = body.sender_user();
if !services.users.is_admin(sender_user).await { if !services.users.is_admin(sender_user).await {
return Err!(Request(Forbidden("Only server administrators can use this endpoint"))); return Err!(Request(Forbidden("Only server administrators can use this endpoint")));
}; }
if !services.globals.user_is_local(&body.user_id) { if !services.globals.user_is_local(&body.user_id) {
return Err!(Request(InvalidParam("Can only check the suspended status of local users"))); return Err!(Request(InvalidParam("Can only check the suspended status of local users")));
}; }
if !services.users.is_active(&body.user_id).await { if !services.users.is_active(&body.user_id).await {
return Err!(Request(NotFound("Unknown user"))); return Err!(Request(NotFound("Unknown user")));
} }
@ -36,10 +36,10 @@ pub(crate) async fn put_suspended_status(
let sender_user = body.sender_user(); let sender_user = body.sender_user();
if !services.users.is_admin(sender_user).await { if !services.users.is_admin(sender_user).await {
return Err!(Request(Forbidden("Only server administrators can use this endpoint"))); return Err!(Request(Forbidden("Only server administrators can use this endpoint")));
}; }
if !services.globals.user_is_local(&body.user_id) { if !services.globals.user_is_local(&body.user_id) {
return Err!(Request(InvalidParam("Can only set the suspended status of local users"))); return Err!(Request(InvalidParam("Can only set the suspended status of local users")));
}; }
if !services.users.is_active(&body.user_id).await { if !services.users.is_active(&body.user_id).await {
return Err!(Request(NotFound("Unknown user"))); return Err!(Request(NotFound("Unknown user")));
} }

View file

@ -19,14 +19,14 @@ use crate::Ruma;
/// of this server. /// of this server.
pub(crate) async fn get_capabilities_route( pub(crate) async fn get_capabilities_route(
State(services): State<crate::State>, State(services): State<crate::State>,
_body: Ruma<get_capabilities::v3::Request>, body: Ruma<get_capabilities::v3::Request>,
) -> Result<get_capabilities::v3::Response> { ) -> Result<get_capabilities::v3::Response> {
let available: BTreeMap<RoomVersionId, RoomVersionStability> = let available: BTreeMap<RoomVersionId, RoomVersionStability> =
Server::available_room_versions().collect(); Server::available_room_versions().collect();
let authenticated = _body.sender_user.as_ref().is_some() let authenticated = body.sender_user.as_ref().is_some()
&& services && services
.users .users
.is_active_local(_body.sender_user.as_ref().unwrap()) .is_active_local(body.sender_user.as_ref().unwrap())
.await; .await;
let mut capabilities = Capabilities::default(); let mut capabilities = Capabilities::default();
@ -53,7 +53,7 @@ pub(crate) async fn get_capabilities_route(
if authenticated if authenticated
&& services && services
.users .users
.is_admin(_body.sender_user.as_ref().unwrap()) .is_admin(body.sender_user.as_ref().unwrap())
.await .await
{ {
// Advertise suspension API // Advertise suspension API