1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2025-06-23 18:11:40 +00:00

Get the list of custom emojies

This commit is contained in:
2020-04-03 16:43:38 +02:00
parent 131735a5f0
commit 6559c3b910
5 changed files with 54 additions and 1 deletions

View File

@ -285,4 +285,18 @@ export class SettingsController {
})
}
/**
* Convert an emoji into an API entry
*
* @param c The emoji to convert
*/
public static CustomEmojiToAPI(c: CustomEmoji) : any {
return {
id: c.id,
userID: c.userID,
shorcut: c.shorcut,
url: c.url
}
}
}

View File

@ -5,6 +5,8 @@ import { AccountImage, AccountImageVisibilityLevel } from "../entities/AccountIm
import { BackgroundImageHelper } from "../helpers/BackgroundImageHelper";
import { LikesHelper, LikesType } from "../helpers/LikesHelper";
import { FriendsHelper } from "../helpers/FriendsHelper";
import { CustomEmojisHelper } from "../helpers/CustomEmojisHelper";
import { SettingsController } from "./SettingsController";
/**
* User information controller
@ -76,7 +78,8 @@ export class UserController {
"publicPage": user.pageStatus == UserPageStatus.PUBLIC,
"openPage": user.pageStatus == UserPageStatus.OPEN,
"virtualDirectory": user.hasVirtualDirectory ? user.virtualDirectory : "",
"accountImage": await this.GetAccountImageURL(user.accountImage, h)
"accountImage": await this.GetAccountImageURL(user.accountImage, h),
"customEmojis": (await CustomEmojisHelper.GetListUser(user.id)).map(SettingsController.CustomEmojiToAPI)
};
if(advanced) {