reduce line width on banned_room_check
Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
parent
c070edc189
commit
a1b0369033
1 changed files with 74 additions and 72 deletions
|
@ -56,8 +56,11 @@ use crate::{client::full_user_deactivate, Ruma};
|
|||
async fn banned_room_check(
|
||||
services: &Services, user_id: &UserId, room_id: Option<&RoomId>, server_name: Option<&ServerName>,
|
||||
client_ip: IpAddr,
|
||||
) -> Result<()> {
|
||||
if !services.users.is_admin(user_id).await {
|
||||
) -> Result {
|
||||
if services.users.is_admin(user_id).await {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
if let Some(room_id) = room_id {
|
||||
if services.rooms.metadata.is_banned(room_id).await
|
||||
|| services
|
||||
|
@ -106,8 +109,8 @@ async fn banned_room_check(
|
|||
.contains(&server_name.to_owned())
|
||||
{
|
||||
warn!(
|
||||
"User {user_id} who is not an admin tried joining a room which has the server name {server_name} \
|
||||
that is globally forbidden. Rejecting.",
|
||||
"User {user_id} who is not an admin tried joining a room which has the server name {server_name} that \
|
||||
is globally forbidden. Rejecting.",
|
||||
);
|
||||
|
||||
if services.globals.config.auto_deactivate_banned_room_attempts {
|
||||
|
@ -138,7 +141,6 @@ async fn banned_room_check(
|
|||
return Err!(Request(Forbidden("This remote server is banned on this homeserver.")));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue