diff --git a/src/admin/room/room_moderation_commands.rs b/src/admin/room/room_moderation_commands.rs index 5989ff73..1876bf5e 100644 --- a/src/admin/room/room_moderation_commands.rs +++ b/src/admin/room/room_moderation_commands.rs @@ -111,15 +111,15 @@ async fn ban_room( user.ok().filter(|local_user| { user_is_local(local_user) // additional wrapped check here is to avoid adding remote users - // who are in the admin room to the list of local users (would fail auth check) + // who are in the admin room to the list of local users (would + // fail auth check) && (user_is_local(local_user) + // since this is a force operation, assume user is an admin + // if somehow this fails && services() .users .is_admin(local_user) - .unwrap_or(true)) // since this is a force - // operation, assume user - // is an admin if somehow - // this fails + .unwrap_or(true)) }) }) .collect::>() @@ -311,19 +311,17 @@ async fn ban_list_of_rooms(body: Vec<&str>, force: bool, disable_federation: boo .filter_map(|user| { user.ok().filter(|local_user| { local_user.server_name() == services().globals.server_name() - // additional wrapped check here is to avoid adding remote users - // who are in the admin room to the list of local users (would fail auth check) + // additional wrapped check here is to avoid adding remote + // users who are in the admin room to the list of local + // users (would fail auth check) && (local_user.server_name() == services().globals.server_name() + // since this is a force operation, assume user is an + // admin if somehow this fails && services() .users .is_admin(local_user) - .unwrap_or(true)) // since this is a - // force operation, - // assume user is - // an admin if - // somehow this - // fails + .unwrap_or(true)) }) }) .collect::>() @@ -344,8 +342,9 @@ async fn ban_list_of_rooms(body: Vec<&str>, force: bool, disable_federation: boo .filter_map(|user| { user.ok().filter(|local_user| { local_user.server_name() == services().globals.server_name() - // additional wrapped check here is to avoid adding remote users - // who are in the admin room to the list of local users (would fail auth check) + // additional wrapped check here is to avoid adding remote + // users who are in the admin room to the list of local + // users (would fail auth check) && (local_user.server_name() == services().globals.server_name() && !services() diff --git a/src/core/config/proxy.rs b/src/core/config/proxy.rs index a2d64fa6..d823e5e4 100644 --- a/src/core/config/proxy.rs +++ b/src/core/config/proxy.rs @@ -47,8 +47,8 @@ impl ProxyConfig { url, } => Some(Proxy::all(url)?), Self::ByDomain(proxies) => Some(Proxy::custom(move |url| { - proxies.iter().find_map(|proxy| proxy.for_url(url)).cloned() // first matching - // proxy + // first matching proxy + proxies.iter().find_map(|proxy| proxy.for_url(url)).cloned() })), }) }