From 2b02035ee33f6e84daae5a8e49ee2fe4852d9762 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Sat, 18 Apr 2020 13:15:14 +0200 Subject: [PATCH] Close all user WS before deleting account --- src/helpers/AccountHelper.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/helpers/AccountHelper.ts b/src/helpers/AccountHelper.ts index 029b08d..d704839 100644 --- a/src/helpers/AccountHelper.ts +++ b/src/helpers/AccountHelper.ts @@ -20,6 +20,7 @@ import { AccountImageHelper } from "./AccountImageHelper"; import { BackgroundImageHelper } from "./BackgroundImageHelper"; import { EventsHelper } from "./EventsHelper"; import { CustomEmojisHelper } from "./CustomEmojisHelper"; +import { UserWebSocketController } from "../controllers/UserWebSocketController"; /** * Account helper @@ -485,6 +486,9 @@ export class AccountHelper { */ public static async Delete(userID: number) { + // Close all websockets of user + await UserWebSocketController.CloseAllUserSockets(userID); + // Delete all groups memberships await GroupsHelper.DeleteAllUsersGroups(userID);