perf(MSC4323): Remove redundant authorisation checks

This commit is contained in:
nexy7574 2025-08-31 18:32:32 +01:00
commit 4e644961f3
No known key found for this signature in database

View file

@ -23,11 +23,6 @@ pub(crate) async fn get_capabilities_route(
) -> Result<get_capabilities::v3::Response> {
let available: BTreeMap<RoomVersionId, RoomVersionStability> =
Server::available_room_versions().collect();
let authenticated = body.sender_user.as_ref().is_some()
&& services
.users
.is_active_local(body.sender_user.as_ref().unwrap())
.await;
let mut capabilities = Capabilities::default();
capabilities.room_versions = RoomVersionsCapability {
@ -50,8 +45,7 @@ pub(crate) async fn get_capabilities_route(
json!({"enabled": services.config.forget_forced_upon_leave}),
)?;
if authenticated
&& services
if services
.users
.is_admin(body.sender_user.as_ref().unwrap())
.await