diff --git a/src/config/mod.rs b/src/config/mod.rs index 6b862bb6..eb15db48 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -52,6 +52,8 @@ pub struct Config { pub allow_unstable_room_versions: bool, #[serde(default = "default_default_room_version")] pub default_room_version: RoomVersionId, + #[serde(default = "default_hierarchy_max_depth")] + pub hierarchy_max_depth: u64, #[serde(default = "false_fn")] pub allow_jaeger: bool, #[serde(default = "false_fn")] @@ -261,3 +263,7 @@ fn default_turn_ttl() -> u64 { pub fn default_default_room_version() -> RoomVersionId { RoomVersionId::V9 } + +fn default_hierarchy_max_depth() -> u64 { + 6 +} diff --git a/src/service/globals/mod.rs b/src/service/globals/mod.rs index affc0516..7aa729f9 100644 --- a/src/service/globals/mod.rs +++ b/src/service/globals/mod.rs @@ -250,6 +250,10 @@ impl Service { self.config.enable_lightning_bolt } + pub fn hierarchy_max_depth(&self) -> u64 { + self.config.hierarchy_max_depth + } + pub fn trusted_servers(&self) -> &[OwnedServerName] { &self.config.trusted_servers }