mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2025-07-17 20:58:05 +00:00
Can check whether a conversation is having a call or not
This commit is contained in:
src
@ -43,6 +43,25 @@ pub fn get_config(r: &mut UserWsRequestHandler) -> RequestResult {
|
||||
r.internal_error(ExecError::boxed_new("Missing calls configuration!"))
|
||||
}
|
||||
|
||||
/// Check out whether a conversation is having a call or not
|
||||
pub fn is_conversation_having_call(conv_id: &ConvID) -> bool {
|
||||
let mut found = false;
|
||||
|
||||
let res = user_ws_controller::foreach_connection(|f| {
|
||||
if found || f.is_having_call_with_conversation(conv_id) {
|
||||
found = true;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
});
|
||||
|
||||
if let Err(e) = res {
|
||||
eprintln!("Failed to check if a conversation is having call! Conversation: {} / Error: {:#?}", conv_id, e);
|
||||
}
|
||||
|
||||
found
|
||||
}
|
||||
|
||||
/// Join a call
|
||||
pub fn join_call(r: &mut UserWsRequestHandler) -> RequestResult {
|
||||
let conv_id = r.post_conv_id("convID")?;
|
||||
|
Reference in New Issue
Block a user