use user_is_local and server_is_ours more, remove few double filters

Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
strawberry 2024-04-28 13:18:09 -04:00 committed by June
parent e7505a4b20
commit 76c5942b4f
11 changed files with 47 additions and 50 deletions

View file

@ -8,7 +8,7 @@ use ruma::{
use tokio::sync::Mutex;
use tracing::warn;
use crate::{services, Config, Error, Result};
use crate::{services, utils::server_name::server_is_ours, Config, Error, Result};
mod appservice;
mod data;
@ -93,7 +93,7 @@ impl Service {
.state_cache
.room_servers(room_id)
.filter_map(Result::ok)
.filter(|server| &**server != services().globals.server_name());
.filter(|server_name| !server_is_ours(server_name));
self.send_pdu_servers(servers, pdu_id)
}
@ -144,7 +144,7 @@ impl Service {
.state_cache
.room_servers(room_id)
.filter_map(Result::ok)
.filter(|server| &**server != services().globals.server_name());
.filter(|server_name| !server_is_ours(server_name));
self.send_edu_servers(servers, serialized)
}
@ -183,7 +183,7 @@ impl Service {
.state_cache
.room_servers(room_id)
.filter_map(Result::ok)
.filter(|server| &**server != services().globals.server_name());
.filter(|server_name| !server_is_ours(server_name));
self.flush_servers(servers)
}