mirror of
				https://gitlab.com/comunic/comunicapiv3
				synced 2025-11-04 01:24:04 +00:00 
			
		
		
		
	Close user websockets when deleting its account
This commit is contained in:
		@@ -1,5 +1,6 @@
 | 
			
		||||
use crate::constants::{PASSWORD_RESET_TOKEN_LENGTH, PASSWORD_RESET_TOKEN_LIFETIME};
 | 
			
		||||
use crate::constants::database_tables_names::{USER_ACCESS_TOKENS_TABLE, USERS_TABLE};
 | 
			
		||||
use crate::controllers::user_ws_controller;
 | 
			
		||||
use crate::data::account_export::AccountExport;
 | 
			
		||||
use crate::data::api_client::APIClient;
 | 
			
		||||
use crate::data::error::{ExecError, ResultBoxError};
 | 
			
		||||
@@ -302,7 +303,8 @@ pub fn export(user_id: &UserID) -> ResultBoxError<AccountExport> {
 | 
			
		||||
 | 
			
		||||
/// Delete a user's account
 | 
			
		||||
pub fn delete(user_id: &UserID) -> ResultBoxError {
 | 
			
		||||
    // TODO : close all websockets of user
 | 
			
		||||
    // Close all WebSockets of user
 | 
			
		||||
    user_ws_controller::disconnect_user_from_all_sockets(user_id)?;
 | 
			
		||||
 | 
			
		||||
    // Delete all group membership
 | 
			
		||||
    groups_helper::delete_all_user_groups(user_id)?;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user