From 3ff6d54be642fb9cdfebcc67a3ff78b0af57c5e2 Mon Sep 17 00:00:00 2001 From: Nyaaori <+@nyaaori.cat> Date: Fri, 2 Sep 2022 16:28:24 +0200 Subject: [PATCH] Add hierarchy_max_depth config option --- src/config/mod.rs | 6 ++++++ src/service/globals/mod.rs | 4 ++++ 2 files changed, 10 insertions(+) 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 }