mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2025-09-25 14:19:45 +00:00
Add "enabled" fields
This commit is contained in:
@@ -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!"))
|
||||
|
@@ -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!"));
|
||||
}
|
||||
|
Reference in New Issue
Block a user