eliminate references to services.globals.config

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2025-01-24 07:02:56 +00:00
parent 7c6b8b132a
commit 5be07ebc0f
26 changed files with 116 additions and 114 deletions

View file

@ -37,7 +37,7 @@ pub(crate) async fn create_invite_route(
if let Some(server) = body.room_id.server_name() {
if services
.globals
.server
.config
.forbidden_remote_server_names
.contains(&server.to_owned())
@ -47,7 +47,7 @@ pub(crate) async fn create_invite_route(
}
if services
.globals
.server
.config
.forbidden_remote_server_names
.contains(body.origin())

View file

@ -42,7 +42,7 @@ pub(crate) async fn create_join_event_template_route(
.await?;
if services
.globals
.server
.config
.forbidden_remote_server_names
.contains(body.origin())
@ -59,7 +59,7 @@ pub(crate) async fn create_join_event_template_route(
if let Some(server) = body.room_id.server_name() {
if services
.globals
.server
.config
.forbidden_remote_server_names
.contains(&server.to_owned())

View file

@ -34,7 +34,7 @@ pub(crate) async fn create_knock_event_template_route(
.await?;
if services
.globals
.server
.config
.forbidden_remote_server_names
.contains(body.origin())
@ -51,7 +51,7 @@ pub(crate) async fn create_knock_event_template_route(
if let Some(server) = body.room_id.server_name() {
if services
.globals
.server
.config
.forbidden_remote_server_names
.contains(&server.to_owned())

View file

@ -20,7 +20,7 @@ pub(crate) async fn get_public_rooms_filtered_route(
body: Ruma<get_public_rooms_filtered::v1::Request>,
) -> Result<get_public_rooms_filtered::v1::Response> {
if !services
.globals
.server
.config
.allow_public_room_directory_over_federation
{

View file

@ -63,7 +63,7 @@ pub(crate) async fn get_profile_information_route(
body: Ruma<get_profile_information::v1::Request>,
) -> Result<get_profile_information::v1::Response> {
if !services
.globals
.server
.config
.allow_inbound_profile_lookup_federation_requests
{

View file

@ -309,7 +309,7 @@ async fn handle_edu_typing(
origin: &ServerName,
typing: TypingContent,
) {
if !services.globals.config.allow_incoming_typing {
if !services.server.config.allow_incoming_typing {
return;
}
@ -344,7 +344,7 @@ async fn handle_edu_typing(
if typing.typing {
let timeout = utils::millis_since_unix_epoch().saturating_add(
services
.globals
.server
.config
.typing_federation_timeout_s
.saturating_mul(1000),

View file

@ -268,7 +268,7 @@ pub(crate) async fn create_join_event_v1_route(
body: Ruma<create_join_event::v1::Request>,
) -> Result<create_join_event::v1::Response> {
if services
.globals
.server
.config
.forbidden_remote_server_names
.contains(body.origin())
@ -284,7 +284,7 @@ pub(crate) async fn create_join_event_v1_route(
if let Some(server) = body.room_id.server_name() {
if services
.globals
.server
.config
.forbidden_remote_server_names
.contains(&server.to_owned())
@ -316,7 +316,7 @@ pub(crate) async fn create_join_event_v2_route(
body: Ruma<create_join_event::v2::Request>,
) -> Result<create_join_event::v2::Response> {
if services
.globals
.server
.config
.forbidden_remote_server_names
.contains(body.origin())
@ -326,7 +326,7 @@ pub(crate) async fn create_join_event_v2_route(
if let Some(server) = body.room_id.server_name() {
if services
.globals
.server
.config
.forbidden_remote_server_names
.contains(&server.to_owned())

View file

@ -22,7 +22,7 @@ pub(crate) async fn create_knock_event_v1_route(
body: Ruma<send_knock::v1::Request>,
) -> Result<send_knock::v1::Response> {
if services
.globals
.server
.config
.forbidden_remote_server_names
.contains(body.origin())
@ -38,7 +38,7 @@ pub(crate) async fn create_knock_event_v1_route(
if let Some(server) = body.room_id.server_name() {
if services
.globals
.server
.config
.forbidden_remote_server_names
.contains(&server.to_owned())