1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2024-11-22 05:19:22 +00:00

Close all user WS before deleting account

This commit is contained in:
Pierre HUBERT 2020-04-18 13:15:14 +02:00
parent f8cf4c5c9c
commit 2b02035ee3

View File

@ -20,6 +20,7 @@ import { AccountImageHelper } from "./AccountImageHelper";
import { BackgroundImageHelper } from "./BackgroundImageHelper"; import { BackgroundImageHelper } from "./BackgroundImageHelper";
import { EventsHelper } from "./EventsHelper"; import { EventsHelper } from "./EventsHelper";
import { CustomEmojisHelper } from "./CustomEmojisHelper"; import { CustomEmojisHelper } from "./CustomEmojisHelper";
import { UserWebSocketController } from "../controllers/UserWebSocketController";
/** /**
* Account helper * Account helper
@ -485,6 +486,9 @@ export class AccountHelper {
*/ */
public static async Delete(userID: number) { public static async Delete(userID: number) {
// Close all websockets of user
await UserWebSocketController.CloseAllUserSockets(userID);
// Delete all groups memberships // Delete all groups memberships
await GroupsHelper.DeleteAllUsersGroups(userID); await GroupsHelper.DeleteAllUsersGroups(userID);