diff --git a/src/api/client_server/account.rs b/src/api/client_server/account.rs index 46551305..c2e251ac 100644 --- a/src/api/client_server/account.rs +++ b/src/api/client_server/account.rs @@ -86,6 +86,17 @@ pub async fn register_route(body: Ruma) -> Result { let proposed_user_id = UserId::parse_with_server_name( diff --git a/src/config/mod.rs b/src/config/mod.rs index c6c2646e..21cf6bf9 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -119,6 +119,9 @@ pub struct Config { #[serde(default = "false_fn")] pub zstd_compression: bool, + #[serde(default = "false_fn")] + pub allow_guest_registration: bool, + #[serde(flatten)] pub catchall: BTreeMap, } @@ -195,6 +198,10 @@ impl fmt::Display for Config { &self.max_concurrent_requests.to_string(), ), ("Allow registration", &self.allow_registration.to_string()), + ( + "Allow guest registration", + &self.allow_guest_registration.to_string(), + ), ( "Enabled lightning bolt", &self.enable_lightning_bolt.to_string(), diff --git a/src/service/globals/mod.rs b/src/service/globals/mod.rs index 21072d40..4df22b1b 100644 --- a/src/service/globals/mod.rs +++ b/src/service/globals/mod.rs @@ -295,6 +295,10 @@ impl Service { self.config.allow_registration } + pub fn allow_guest_registration(&self) -> bool { + self.config.allow_guest_registration + } + pub fn allow_encryption(&self) -> bool { self.config.allow_encryption }