|
|
|
@ -10,6 +10,7 @@ pub struct Globals { |
|
|
|
reqwest_client: reqwest::Client, |
|
|
|
reqwest_client: reqwest::Client, |
|
|
|
server_name: Box<ServerName>, |
|
|
|
server_name: Box<ServerName>, |
|
|
|
registration_disabled: bool, |
|
|
|
registration_disabled: bool, |
|
|
|
|
|
|
|
encryption_disabled: bool, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
impl Globals { |
|
|
|
impl Globals { |
|
|
|
@ -33,6 +34,7 @@ impl Globals { |
|
|
|
.try_into() |
|
|
|
.try_into() |
|
|
|
.map_err(|_| Error::BadConfig("Invalid server name found."))?, |
|
|
|
.map_err(|_| Error::BadConfig("Invalid server name found."))?, |
|
|
|
registration_disabled: config.get_bool("registration_disabled").unwrap_or(false), |
|
|
|
registration_disabled: config.get_bool("registration_disabled").unwrap_or(false), |
|
|
|
|
|
|
|
encryption_disabled: config.get_bool("encryption_disabled").unwrap_or(false), |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -70,4 +72,8 @@ impl Globals { |
|
|
|
pub fn registration_disabled(&self) -> bool { |
|
|
|
pub fn registration_disabled(&self) -> bool { |
|
|
|
self.registration_disabled |
|
|
|
self.registration_disabled |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pub fn encryption_disabled(&self) -> bool { |
|
|
|
|
|
|
|
self.encryption_disabled |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|