mirror of
				https://gitlab.com/comunic/comunicapiv2
				synced 2025-10-31 01:24:43 +00:00 
			
		
		
		
	Can close all active websockets of a user
This commit is contained in:
		| @@ -220,6 +220,16 @@ export class UserWebSocketController { | |||||||
| 			entry.ws.close(); | 			entry.ws.close(); | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|  | 	/** | ||||||
|  | 	 * Close all user websockets | ||||||
|  | 	 *  | ||||||
|  | 	 * @param userID Target user ID | ||||||
|  | 	 */ | ||||||
|  | 	public static async CloseAllUserSockets(userID: number) { | ||||||
|  | 		for(const entry of this.active_clients.filter((f) => f.userID == userID)) | ||||||
|  | 			entry.ws.close(); | ||||||
|  | 	} | ||||||
|  |  | ||||||
| 	/** | 	/** | ||||||
| 	 * Send a message to a socket | 	 * Send a message to a socket | ||||||
| 	 *  | 	 *  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user