refactor: allow for post-processing on the config

This commit is contained in:
Matthias Ahouansou
2025-03-23 12:26:28 +00:00
parent 7b9ba62b67
commit 937521fcf1
2 changed files with 190 additions and 68 deletions

View File

@@ -349,7 +349,18 @@ impl Service {
}
pub fn turn(&self) -> Option<TurnConfig> {
self.config.turn()
// We have to clone basically the entire thing on `/turnServers` otherwise
self.config.turn.clone()
}
pub fn well_known_server(&self) -> OwnedServerName {
// Same as above, but for /.well-known/matrix/server
self.config.well_known.server.clone()
}
pub fn well_known_client(&self) -> String {
// Same as above, but for /.well-known/matrix/client
self.config.well_known.client.clone()
}
pub fn dns_resolver(&self) -> &TokioAsyncResolver {
@@ -481,14 +492,6 @@ impl Service {
r
}
pub fn well_known_server(&self) -> OwnedServerName {
self.config.well_known_server()
}
pub fn well_known_client(&self) -> String {
self.config.well_known_client()
}
pub fn shutdown(&self) {
self.shutdown.store(true, atomic::Ordering::Relaxed);
// On shutdown