pull stuff out of globals

This commit is contained in:
dasha_uwu
2025-09-23 02:37:31 +05:00
committed by Jason Volk
parent 6bb101ac51
commit 89a67af607
17 changed files with 83 additions and 221 deletions

View File

@@ -59,8 +59,8 @@ pub(crate) async fn get_public_rooms_route(
body: Ruma<get_public_rooms::v1::Request>,
) -> Result<get_public_rooms::v1::Response> {
if !services
.globals
.allow_public_room_directory_over_federation()
.config
.allow_public_room_directory_over_federation
{
return Err(Error::BadRequest(ErrorKind::forbidden(), "Room directory is not public"));
}

View File

@@ -44,7 +44,7 @@ pub(crate) async fn get_devices_route(
let device_id = metadata.device_id.clone();
let device_id_clone = device_id.clone();
let device_id_string = device_id.as_str().to_owned();
let device_display_name = if services.globals.allow_device_name_federation() {
let device_display_name = if services.config.allow_device_name_federation {
metadata.display_name.clone()
} else {
Some(device_id_string)
@@ -95,7 +95,7 @@ pub(crate) async fn get_keys_route(
None,
&body.device_keys,
|u| Some(u.server_name()) == body.origin.as_deref(),
services.globals.allow_device_name_federation(),
services.config.allow_device_name_federation,
)
.await?;