ignore deactivated users and remote user profiles wih forbidden_usernames
Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
parent
8c3f946e97
commit
b78d79a45a
1 changed files with 7 additions and 2 deletions
|
@ -933,8 +933,13 @@ impl KeyValueDatabase {
|
|||
{
|
||||
let patterns = &services().globals.config.forbidden_usernames;
|
||||
if !patterns.is_empty() {
|
||||
for user in services().users.iter() {
|
||||
let user_id = user?;
|
||||
for user_id in services()
|
||||
.users
|
||||
.iter()
|
||||
.filter_map(std::result::Result::ok)
|
||||
.filter(|user| !services().users.is_deactivated(user).unwrap_or(true))
|
||||
.filter(|user| user.server_name() == services().globals.server_name())
|
||||
{
|
||||
let matches = patterns.matches(user_id.localpart());
|
||||
if matches.matched_any() {
|
||||
warn!(
|
||||
|
|
Loading…
Add table
Reference in a new issue