rustfmt nightly/stable compats
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
02bd67dc4b
commit
48d9677959
2 changed files with 16 additions and 17 deletions
|
@ -111,15 +111,15 @@ async fn ban_room(
|
||||||
user.ok().filter(|local_user| {
|
user.ok().filter(|local_user| {
|
||||||
user_is_local(local_user)
|
user_is_local(local_user)
|
||||||
// additional wrapped check here is to avoid adding remote users
|
// 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)
|
&& (user_is_local(local_user)
|
||||||
|
// since this is a force operation, assume user is an admin
|
||||||
|
// if somehow this fails
|
||||||
&& services()
|
&& services()
|
||||||
.users
|
.users
|
||||||
.is_admin(local_user)
|
.is_admin(local_user)
|
||||||
.unwrap_or(true)) // since this is a force
|
.unwrap_or(true))
|
||||||
// operation, assume user
|
|
||||||
// is an admin if somehow
|
|
||||||
// this fails
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.collect::<Vec<OwnedUserId>>()
|
.collect::<Vec<OwnedUserId>>()
|
||||||
|
@ -311,19 +311,17 @@ async fn ban_list_of_rooms(body: Vec<&str>, force: bool, disable_federation: boo
|
||||||
.filter_map(|user| {
|
.filter_map(|user| {
|
||||||
user.ok().filter(|local_user| {
|
user.ok().filter(|local_user| {
|
||||||
local_user.server_name() == services().globals.server_name()
|
local_user.server_name() == services().globals.server_name()
|
||||||
// additional wrapped check here is to avoid adding remote users
|
// additional wrapped check here is to avoid adding remote
|
||||||
// who are in the admin room to the list of local users (would fail auth check)
|
// users who are in the admin room to the list of local
|
||||||
|
// users (would fail auth check)
|
||||||
&& (local_user.server_name()
|
&& (local_user.server_name()
|
||||||
== services().globals.server_name()
|
== services().globals.server_name()
|
||||||
|
// since this is a force operation, assume user is an
|
||||||
|
// admin if somehow this fails
|
||||||
&& services()
|
&& services()
|
||||||
.users
|
.users
|
||||||
.is_admin(local_user)
|
.is_admin(local_user)
|
||||||
.unwrap_or(true)) // since this is a
|
.unwrap_or(true))
|
||||||
// force operation,
|
|
||||||
// assume user is
|
|
||||||
// an admin if
|
|
||||||
// somehow this
|
|
||||||
// fails
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.collect::<Vec<OwnedUserId>>()
|
.collect::<Vec<OwnedUserId>>()
|
||||||
|
@ -344,8 +342,9 @@ async fn ban_list_of_rooms(body: Vec<&str>, force: bool, disable_federation: boo
|
||||||
.filter_map(|user| {
|
.filter_map(|user| {
|
||||||
user.ok().filter(|local_user| {
|
user.ok().filter(|local_user| {
|
||||||
local_user.server_name() == services().globals.server_name()
|
local_user.server_name() == services().globals.server_name()
|
||||||
// additional wrapped check here is to avoid adding remote users
|
// additional wrapped check here is to avoid adding remote
|
||||||
// who are in the admin room to the list of local users (would fail auth check)
|
// users who are in the admin room to the list of local
|
||||||
|
// users (would fail auth check)
|
||||||
&& (local_user.server_name()
|
&& (local_user.server_name()
|
||||||
== services().globals.server_name()
|
== services().globals.server_name()
|
||||||
&& !services()
|
&& !services()
|
||||||
|
|
|
@ -47,8 +47,8 @@ impl ProxyConfig {
|
||||||
url,
|
url,
|
||||||
} => Some(Proxy::all(url)?),
|
} => Some(Proxy::all(url)?),
|
||||||
Self::ByDomain(proxies) => Some(Proxy::custom(move |url| {
|
Self::ByDomain(proxies) => Some(Proxy::custom(move |url| {
|
||||||
proxies.iter().find_map(|proxy| proxy.for_url(url)).cloned() // first matching
|
// first matching proxy
|
||||||
// proxy
|
proxies.iter().find_map(|proxy| proxy.for_url(url)).cloned()
|
||||||
})),
|
})),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue