Remove emojification on message send

This commit is contained in:
Ken Powers 2020-05-07 15:58:28 -04:00 committed by GitHub
parent 4811b5fd4d
commit 7a55c68c6c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 25 deletions

View file

@ -274,22 +274,6 @@ export function emojiToImage(emoji: string): string | undefined {
return imageByEmoji[emoji];
}
export function replaceColons(str: string) {
return str.replace(/:[a-z0-9-_+]+:(?::skin-tone-[1-5]:)?/gi, m => {
const [shortName = '', skinTone = '0'] = m
.replace('skin-tone-', '')
.toLowerCase()
.split(':')
.filter(Boolean);
if (shortName && isShortName(shortName)) {
return convertShortName(shortName, parseInt(skinTone, 10));
}
return m;
});
}
function getCountOfAllMatches(str: string, regex: RegExp) {
let match = regex.exec(str);
let count = 0;