mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2024-11-21 21:09:22 +00:00
Can close all active websockets of a user
This commit is contained in:
parent
59825401b5
commit
f8cf4c5c9c
@ -220,6 +220,16 @@ export class UserWebSocketController {
|
||||
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
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user