Skip to content

Commit

Permalink
Adjusted emoji script for custom emoji
Browse files Browse the repository at this point in the history
  • Loading branch information
jherman00 committed Apr 26, 2024
1 parent 2224222 commit 0392f26
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
24 changes: 12 additions & 12 deletions webapp/channels/build/emoji/make_emojis.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@
* npm run make-emojis -- --help
*/

import path from 'node:path';
import * as fsPromise from 'node:fs/promises';
import * as fs from 'node:fs';
import * as fsPromise from 'node:fs/promises';
import path from 'node:path';
import * as url from 'node:url';

import yargs from 'yargs';
import chalk from 'chalk';
import jsonData from 'emoji-datasource/emoji.json';
import jsonCategories from 'emoji-datasource/categories.json';
import jsonCategories from 'emoji-datasource/categories.json' assert { type: 'json' };
import jsonData from 'emoji-datasource/emoji.json' assert { type: 'json' };
import yargs from 'yargs';

import additionalShortnames from './additional_shortnames.json';
import additionalShortnames from './additional_shortnames.json' assert { type: 'json' };

const EMOJI_SIZE = 64;
const EMOJI_SIZE_PADDED = EMOJI_SIZE + 2; // 1px per side
Expand Down Expand Up @@ -126,7 +126,7 @@ readMissingDirPromise.then(() => {

// Copy mattermost emoji image
const webappImagesDir = path.resolve(webappRootDir, 'channels', 'src', 'images');
endResults.push(copyFileAndPrint(path.resolve(webappImagesDir, 'icon64x64.png'), path.resolve(webappImagesDir, 'emoji/mattermost.png'), 'mattermost-emoji'));
endResults.push(copyFileAndPrint(path.resolve(webappImagesDir, 'icon64x64.png'), path.resolve(webappImagesDir, 'emoji/grommunio.png'), 'grommunio-emoji'));

const sheetSource = path.resolve(webappRootDir, `node_modules/emoji-datasource-apple/img/apple/sheets/${EMOJI_SIZE}.png`);
const sheetAbsoluteFile = path.resolve(webappRootDir, 'channels', 'src', 'images/emoji-sheets/apple-sheet.png');
Expand Down Expand Up @@ -213,12 +213,12 @@ fullEmoji.forEach((emoji) => {

// add built-in custom emojis
fullEmoji.push({
id: 'mattermost',
name: 'Mattermost',
id: 'grommunio',
name: 'grommunio',
unified: '',
image: 'mattermost.png',
short_name: 'mattermost',
short_names: ['mattermost'],
image: 'grommunio.png',
short_name: 'grommunio',
short_names: ['grommunio'],
category: 'custom',
});

Expand Down
Binary file removed webapp/channels/src/images/emoji/mattermost.png
Binary file not shown.
Binary file modified webapp/channels/src/images/icon64x64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ export function isSystemEmoji(emoji: Emoji): emoji is SystemEmoji {

export function getEmojiImageUrl(emoji: Emoji): string {
// If its the mattermost custom emoji
if (!isSystemEmoji(emoji) && emoji.id === 'mattermost') {
return Client4.getSystemEmojiImageUrl('mattermost');
if (!isSystemEmoji(emoji) && emoji.id === 'grommunio') {
return Client4.getSystemEmojiImageUrl('grommunio');
}

if (isSystemEmoji(emoji)) {
Expand Down

0 comments on commit 0392f26

Please sign in to comment.