1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2025-09-25 14:19:45 +00:00

Add "enabled" fields

This commit is contained in:
2021-10-16 17:45:25 +02:00
parent 43c76fa120
commit b7a0208e71
5 changed files with 24 additions and 4 deletions

View File

@@ -94,9 +94,11 @@ pub fn get_config(r: &mut UserWsRequestHandler) -> RequestResult {
r.forbidden("You do not belong to any call yet!".to_string())?;
}
if let Some(conf) = conf().rtc_relay.as_ref()
{
return r.set_response(UserCallsConfig::new(conf));
if conf().is_rtc_relay_enabled() {
if let Some(conf) = conf().rtc_relay.as_ref()
{
return r.set_response(UserCallsConfig::new(conf));
}
}
r.internal_error(ExecError::boxed_new("Missing calls configuration!"))

View File

@@ -237,7 +237,7 @@ pub async fn open_ws(req: actix_web::HttpRequest,
let ip = req.peer_addr().unwrap();
// Check if video calls are enabled
if conf().rtc_relay.is_none() {
if !conf().is_rtc_relay_enabled() {
eprintln!("A relay from {} tried to connect to the server but the relay is disabled!", ip);
return Ok(actix_web::HttpResponse::BadRequest().body("RTC Relay not configured!"));
}