From 59825401b5970e6cbd2939bc3f999dd53fedbe45 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Sat, 18 Apr 2020 12:20:08 +0200 Subject: [PATCH] Can delete an account --- src/helpers/AccountHelper.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/helpers/AccountHelper.ts b/src/helpers/AccountHelper.ts index 43aad75..029b08d 100644 --- a/src/helpers/AccountHelper.ts +++ b/src/helpers/AccountHelper.ts @@ -19,6 +19,7 @@ import { NotificationsHelper } from "./NotificationsHelper"; import { AccountImageHelper } from "./AccountImageHelper"; import { BackgroundImageHelper } from "./BackgroundImageHelper"; import { EventsHelper } from "./EventsHelper"; +import { CustomEmojisHelper } from "./CustomEmojisHelper"; /** * Account helper @@ -484,7 +485,7 @@ export class AccountHelper { */ public static async Delete(userID: number) { - /*// Delete all groups memberships + // Delete all groups memberships await GroupsHelper.DeleteAllUsersGroups(userID); // Delete all user comments @@ -523,13 +524,16 @@ export class AccountHelper { // Delete user background image await BackgroundImageHelper.Delete(userID); - // TODO : Delete custom user emojies - + // Delete custom user emojies + await CustomEmojisHelper.DeleteAllUser(userID); + // Delete connections to all services await this.DeleteAllUserLoginTokens(userID); - */ + // Delete user from the database - // WILL BE IMPLEMENTED LATER + await DatabaseHelper.DeleteRows(USER_TABLE, { + ID: userID + }) } } \ No newline at end of file