mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2024-11-22 21:39:21 +00:00
Fix issue when closing connection
This commit is contained in:
parent
60541d1651
commit
b6350cb3b3
@ -464,16 +464,16 @@ pub fn handle_event(e: &events_helper::Event) -> Res {
|
|||||||
|
|
||||||
// Call active call of user (if any)
|
// Call active call of user (if any)
|
||||||
Event::DeletedConversation(conv_id) => {
|
Event::DeletedConversation(conv_id) => {
|
||||||
let mut conn = None;
|
let mut connections = vec![];
|
||||||
user_ws_controller::foreach_connection(|f| {
|
user_ws_controller::foreach_connection(|f| {
|
||||||
if f.is_having_call_with_conversation(conv_id) {
|
if f.is_having_call_with_conversation(conv_id) {
|
||||||
conn = Some(f.clone());
|
connections.push(f.clone());
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
if let Some(c) = conn {
|
for con in connections {
|
||||||
make_user_leave_call(conv_id, &c)?;
|
make_user_leave_call(conv_id, &con)?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user