1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-08-04 11:44:00 +00:00

Make sending combined emoji work

This commit is contained in:
Mm2PL 2021-12-12 00:15:29 +01:00
parent d25da5f284
commit d1e37e1c1b
No known key found for this signature in database
GPG key ID: 94AC9B80EFA15ED9
2 changed files with 5 additions and 0 deletions

View file

@ -48,6 +48,7 @@ export const SKIN_TONES = {
5: '1f3ff' 5: '1f3ff'
}; };
export const JOINER_REPLACEMENT = /(?<!\u{E0002})\u{E0002}/gu; export const JOINER_REPLACEMENT = /(?<!\u{E0002})\u{E0002}/gu;
export const EMOJI_JOINER = '\u{E0002}';
export const IMAGE_PATHS = { export const IMAGE_PATHS = {
google: 'noto', google: 'noto',

View file

@ -11,6 +11,7 @@ import { TWITCH_POINTS_SETS, TWITCH_GLOBAL_SETS, TWITCH_PRIME_SETS, KNOWN_CODES,
import Twilight from 'site'; import Twilight from 'site';
import { FFZEvent } from 'src/utilities/events'; import { FFZEvent } from 'src/utilities/events';
import { getTwitchEmoteSrcSet, getTwitchEmoteURL } from 'src/utilities/object'; import { getTwitchEmoteSrcSet, getTwitchEmoteURL } from 'src/utilities/object';
import {EMOJI_JOINER} from 'src/modules/chat/emoji';
export default class Input extends Module { export default class Input extends Module {
constructor(...args) { constructor(...args) {
@ -405,6 +406,9 @@ export default class Input extends Module {
t.log.error(err); t.log.error(err);
} }
// replace ZERO WIDTH JOINER with custom joiner so combined emoji work
inst.autocompleteInputRef.setValue(inst.chatInputRef.value.replace('\u{200d}', EMOJI_JOINER));
originalOnMessageSend.call(this, event); originalOnMessageSend.call(this, event);
} }
} }