From b2aa37001566d8b5bc99cc90298d2fa5404e835a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82?= Date: Thu, 4 Mar 2021 01:13:36 +0100 Subject: [PATCH] Fixed emote pasting bug with multiple spaces (#2490) --- CHANGELOG.md | 2 +- src/providers/twitch/TwitchMessageBuilder.cpp | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e3d8158c1..b88b2b58d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -60,7 +60,7 @@ - Bugfix: /usercard command will now respect the "Automatically close user popup" setting (#1918) - Bugfix: Handle symlinks properly when saving commands & settings (#1856, #1908) - Bugfix: Starting Chatterino in a minimized state after an update will no longer cause a crash -- Bugfix: Modify the emote parsing to handle some edge-cases with dots and stuff (#1704, #1714) +- Bugfix: Modify the emote parsing to handle some edge-cases with dots and stuff. (#1704, #1714, #2490) - Bugfix: Fixed timestamps being incorrect on some messages loaded from the recent-messages service on startup (#1286, #2020) - Bugfix: Fixed timestamps missing on channel point redemption messages (#1943) - Bugfix: Fixed tooltip didn't show in `EmotePopup` depending on the `Link preview` setting enabled or no (#2008) diff --git a/src/providers/twitch/TwitchMessageBuilder.cpp b/src/providers/twitch/TwitchMessageBuilder.cpp index 522c7f463..aea1f0f45 100644 --- a/src/providers/twitch/TwitchMessageBuilder.cpp +++ b/src/providers/twitch/TwitchMessageBuilder.cpp @@ -366,6 +366,12 @@ void TwitchMessageBuilder::addWords( for (auto word : words) { + if (word.isEmpty()) + { + cursor++; + continue; + } + while (doesWordContainATwitchEmote(cursor, word, twitchEmotes, currentTwitchEmoteIt)) {