From 5600c255483cfd4485ea517fa7fa83182e3b0e02 Mon Sep 17 00:00:00 2001 From: Nerixyz Date: Tue, 3 Sep 2024 11:22:21 +0200 Subject: [PATCH 1/2] fix: don't add sets without emotes when searching --- src/widgets/dialogs/EmotePopup.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/widgets/dialogs/EmotePopup.cpp b/src/widgets/dialogs/EmotePopup.cpp index 156d0882ddd..8b62b0e02b4 100644 --- a/src/widgets/dialogs/EmotePopup.cpp +++ b/src/widgets/dialogs/EmotePopup.cpp @@ -115,12 +115,13 @@ auto makeEmojiMessage(const std::vector &emojiMap) return builder.release(); } -void addEmotes(Channel &channel, auto emotes, const QString &title, +void addEmotes(Channel &channel, auto &&emotes, const QString &title, const MessageElementFlag &emoteFlag) { channel.addMessage(makeTitleMessage(title), MessageContext::Original); - channel.addMessage(makeEmoteMessage(emotes, emoteFlag), - MessageContext::Original); + channel.addMessage( + makeEmoteMessage(std::forward(emotes), emoteFlag), + MessageContext::Original); } void addTwitchEmoteSets(const std::shared_ptr &local, @@ -175,7 +176,7 @@ void loadEmojis(Channel &channel, const std::vector &emojiMap, // Create an emote EmoteMap filterEmoteMap(const QString &text, - std::shared_ptr emotes) + const std::shared_ptr &emotes) { EmoteMap filteredMap; @@ -518,15 +519,19 @@ void EmotePopup::filterTwitchEmotes(std::shared_ptr searchChannel, if (!local.empty()) { addEmotes(*searchChannel, local, - this->twitchChannel_->getName() % u" (local)", + this->twitchChannel_->getName() % u" (Follower)", MessageElementFlag::TwitchEmote); } for (const auto &[_id, set] : **getApp()->getAccounts()->twitch.getCurrent()->accessEmoteSets()) { - addEmotes(*searchChannel, filterEmoteVec(searchText, set.emotes), - set.title(), MessageElementFlag::TwitchEmote); + auto filtered = filterEmoteVec(searchText, set.emotes); + if (!filtered.empty()) + { + addEmotes(*searchChannel, std::move(filtered), set.title(), + MessageElementFlag::TwitchEmote); + } } } From aa999f5f67c53e1061b3f3253158030c15f946b8 Mon Sep 17 00:00:00 2001 From: Nerixyz Date: Tue, 3 Sep 2024 11:24:44 +0200 Subject: [PATCH 2/2] chore: add changelog entry --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b6bcda5cc74..f7fff5f035a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,7 +43,7 @@ - Bugfix: Fixed splits staying paused after unfocusing Chatterino in certain configurations. (#5504) - Bugfix: Links with invalid characters in the domain are no longer detected. (#5509) - Bugfix: Fixed janky selection for messages with RTL segments (selection is still wrong, but consistently wrong). (#5525) -- Bugfix: Fixed event emotes not showing up in autocomplete and popups. (#5239, #5580) +- Bugfix: Fixed event emotes not showing up in autocomplete and popups. (#5239, #5580, #5582) - Bugfix: Fixed tab visibility being controllable in the emote popup. (#5530) - Bugfix: Fixed account switch not being saved if no other settings were changed. (#5558) - Bugfix: Fixed some tooltips not being readable. (#5578)