mirror of
				https://gitlab.com/comunic/comunicapiv3
				synced 2025-10-30 23:24:42 +00:00 
			
		
		
		
	Close call when user is removed from a conversation
This commit is contained in:
		| @@ -447,6 +447,21 @@ pub fn handle_event(e: &events_helper::Event) -> Res { | ||||
|             })?; | ||||
|         } | ||||
|  | ||||
|         // Call active call of user (if any) | ||||
|         Event::RemovedUserFromConversation(user_id, conv_id) => { | ||||
|             let mut conn = None; | ||||
|             user_ws_controller::foreach_connection(|f| { | ||||
|                 if f.user_id() == user_id && f.is_having_call_with_conversation(conv_id) { | ||||
|                     conn = Some(f.clone()); | ||||
|                 } | ||||
|                 Ok(()) | ||||
|             })?; | ||||
|  | ||||
|             if let Some(c) = conn { | ||||
|                 make_user_leave_call(conv_id, &c)?; | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         _ => {} | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -517,7 +517,7 @@ pub fn handle_event(e: &events_helper::Event) -> Res { | ||||
|                 None::<fn(&_) -> _>, | ||||
|             )?; | ||||
|  | ||||
|             // Disconnected users | ||||
|             // Disconnect users from conversation | ||||
|             user_ws_controller::foreach_connection(|f| { | ||||
|                 if f.user_id() == user_id && f.conversations.contains(conv_id) { | ||||
|                     f.clone().replace(|w| { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user