1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2025-02-18 06:52:39 +00:00
comunicapiv2/src/entities/CustomEmoji.ts

36 lines
619 B
TypeScript
Raw Normal View History

2020-04-03 16:20:08 +02:00
/**
* Custom smiley
*
* @author Pierre Hubert
*/
2020-04-03 16:43:38 +02:00
import { pathUserData } from "../utils/UserDataUtils";
2020-04-03 16:20:08 +02:00
export interface CustomEmojiBuilder {
id: number,
userID: number,
2020-04-29 16:57:12 +02:00
shortcut: string,
2020-04-03 16:20:08 +02:00
path: string,
}
export class CustomEmoji implements CustomEmojiBuilder {
id: number;
userID: number;
2020-04-29 16:57:12 +02:00
shortcut: string;
2020-04-03 16:20:08 +02:00
path: string;
public constructor(info: CustomEmojiBuilder) {
for (const key in info) {
if (info.hasOwnProperty(key))
this[key] = info[key];
}
}
2020-04-03 16:43:38 +02:00
get url() : string {
return pathUserData(this.path, false);
}
2020-04-03 18:55:50 +02:00
get sysPath() : string {
return pathUserData(this.path, true);
}
2020-04-03 16:20:08 +02:00
}