mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2025-07-12 02:22:50 +00:00
Get more accurate info
This commit is contained in:
src
@ -482,6 +482,12 @@ pub fn is_user_connected(user_id: &UserID) -> bool {
|
||||
get_ws_connections_list().lock().unwrap().iter().any(|c| &c.user_id == user_id)
|
||||
}
|
||||
|
||||
/// Check out whether user is connected or not and has at list one not incognito connection
|
||||
pub fn is_user_connected_not_incognito(user_id: &UserID) -> bool {
|
||||
get_ws_connections_list().lock().unwrap().iter().any(|c| &c.user_id == user_id && !c.incognito)
|
||||
}
|
||||
|
||||
|
||||
/// Disconnect a user from all the WebSockets of a given client
|
||||
pub fn disconnect_user_from_client(user_id: &UserID, client: &APIClient) -> Res {
|
||||
let connections = get_ws_connections_list()
|
||||
|
Reference in New Issue
Block a user