From 74b74fe76b7ffd63b85140e0c8dba0611687d923 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Wed, 10 Feb 2021 18:07:55 +0100 Subject: [PATCH] Check if a user is a member of a call before giving him calls configuration --- src/controllers/calls_controller.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/controllers/calls_controller.rs b/src/controllers/calls_controller.rs index 4f168d6..0f4a338 100644 --- a/src/controllers/calls_controller.rs +++ b/src/controllers/calls_controller.rs @@ -30,7 +30,10 @@ pub fn get_legacy_config(r: &mut HttpRequestHandler) -> RequestResult { /// Get calls configuration pub fn get_config(r: &mut UserWsRequestHandler) -> RequestResult { - // TODO : check whether the user is the member of a call or not + // Check whether the user is the member of a call or not + if let None = r.get_conn().active_call { + r.forbidden("You do not belong to any call yet!".to_string())?; + } if let Some(conf) = conf().rtc_relay.as_ref() {