Skip to content

Commit

Permalink
[MM-35909] Support for emoji 13 (mattermost#5497)
Browse files Browse the repository at this point in the history
* support for emoji 13

* fix some tests

* more test fixed

* fix typo

* rename system to standard

* remove unused functions

* fix +1 emojis
  • Loading branch information
Willyfrog authored Jun 29, 2021
1 parent 15a311f commit 1f843dd
Showing 22 changed files with 8,028 additions and 3,541 deletions.
6 changes: 4 additions & 2 deletions app/actions/views/emoji.js
Original file line number Diff line number Diff line change
@@ -120,15 +120,17 @@ export function addRecentUsedEmojisInMessage(message) {
const unicode = emojiUnicode(emoji);
const index = EmojiIndicesByUnicode.get(unicode || '');
if (index) {
emojisAvailableWithMattermost.push(Emojis[index].aliases[0]);
const name = 'short_name' in Emojis[index] ? Emojis[index].short_name : Emojis[index].name;
emojisAvailableWithMattermost.push(name);
}
}
}
if (namedEmojis) {
for (const emoji of namedEmojis) {
const index = EmojiIndicesByAlias.get(emoji.slice(1, -1));
if (index) {
emojisAvailableWithMattermost.push(Emojis[index].aliases[0]);
const name = 'short_name' in Emojis[index] ? Emojis[index].short_name : Emojis[index].name;
emojisAvailableWithMattermost.push(name);
}
}
}
5 changes: 0 additions & 5 deletions app/client/rest/emojis.ts
Original file line number Diff line number Diff line change
@@ -15,7 +15,6 @@ export interface ClientEmojisMix {
getCustomEmojiByName: (name: string) => Promise<CustomEmoji>;
getCustomEmojis: (page?: number, perPage?: number, sort?: string) => Promise<CustomEmoji[]>;
deleteCustomEmoji: (emojiId: string) => Promise<any>;
getSystemEmojiImageUrl: (filename: string) => string;
getCustomEmojiImageUrl: (id: string) => string;
searchCustomEmoji: (term: string, options?: Record<string, any>) => Promise<CustomEmoji[]>;
autocompleteCustomEmoji: (name: string) => Promise<CustomEmoji[]>;
@@ -75,10 +74,6 @@ const ClientEmojis = (superclass: any) => class extends superclass {
);
};

getSystemEmojiImageUrl = (filename: string) => {
return `${this.url}/static/emoji/${filename}.png`;
};

getCustomEmojiImageUrl = (id: string) => {
return `${this.getEmojiRoute(id)}/image`;
};
Loading
Oops, something went wrong.

0 comments on commit 1f843dd

Please sign in to comment.