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
|
|
|
}
|