mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2025-06-20 00:25:17 +00:00
Get the list of custom emojies
This commit is contained in:
@ -522,6 +522,8 @@ export class AccountHelper {
|
||||
|
||||
// Delete user background image
|
||||
await BackgroundImageHelper.Delete(userID);
|
||||
|
||||
// TODO : Delete custom user emojies
|
||||
|
||||
// Delete connections to all services
|
||||
await this.DeleteAllUserLoginTokens(userID);
|
||||
|
@ -28,4 +28,32 @@ export class CustomEmojisHelper {
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the list of emojies of a given user
|
||||
*
|
||||
* @param userID Target user ID
|
||||
*/
|
||||
public static async GetListUser(userID: number) : Promise<CustomEmoji[]> {
|
||||
return (await DatabaseHelper.Query({
|
||||
table: EMOJIS_TABLE,
|
||||
where: {
|
||||
user_id: userID
|
||||
}
|
||||
})).map((e) => this.DbToCustomEmoji(e));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Turn a database entry into a custom emoji
|
||||
*
|
||||
* @param row Database entry
|
||||
*/
|
||||
private static DbToCustomEmoji(row: any) : CustomEmoji {
|
||||
return new CustomEmoji({
|
||||
id: row.id,
|
||||
userID: row.user_id,
|
||||
shorcut: row.shorcut,
|
||||
path: row.path
|
||||
})
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user