From 1aedd4d6685cf299f65c5fdb1e36225c4f574be7 Mon Sep 17 00:00:00 2001 From: pajlada Date: Sat, 5 Aug 2023 16:23:40 +0200 Subject: [PATCH] Highlights loaded from message history will now correctly appear in the /mentions channel (#4752) * added messages in mentions tab if correct predicate is met * Update CHANGELOG.md * Apply Felanbird's fix Co-authored-by: Felanbird <41973452+Felanbird@users.noreply.github.com> --------- Co-authored-by: 2547techno Co-authored-by: 2547techno <109011672+2547techno@users.noreply.github.com> Co-authored-by: Mm2PL Co-authored-by: Felanbird <41973452+Felanbird@users.noreply.github.com> --- CHANGELOG.md | 1 + src/providers/twitch/TwitchChannel.cpp | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cd27db1a..686e966a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ - Minor: 7TV badges now automatically update upon changing. (#4512) - Minor: Stream status requests are now batched. (#4713) - Minor: Added `/c2-theme-autoreload` command to automatically reload a custom theme. This is useful for when you're developing your own theme. (#4718) +- Minor: Highlights loaded from message history will now correctly appear in the /mentions tab. (#4475) - Minor: All channels opened in browser tabs are synced when using the extension for quicker switching between tabs. (#4741) - Minor: Show channel point redemptions without messages in usercard. (#4557) - Minor: Allow for customizing the behavior of `Right Click`ing of usernames. (#4622, #4751) diff --git a/src/providers/twitch/TwitchChannel.cpp b/src/providers/twitch/TwitchChannel.cpp index 03e22282..c34a3a03 100644 --- a/src/providers/twitch/TwitchChannel.cpp +++ b/src/providers/twitch/TwitchChannel.cpp @@ -1121,6 +1121,21 @@ void TwitchChannel::loadRecentMessages() tc->addMessagesAtStart(messages); tc->loadingRecentMessages_.clear(); + + std::vector msgs; + for (MessagePtr msg : messages) + { + const auto highlighted = + msg->flags.has(MessageFlag::Highlighted); + const auto showInMentions = + msg->flags.has(MessageFlag::ShowInMentions); + if (highlighted && showInMentions) + { + msgs.push_back(msg); + } + } + + getApp()->twitch->mentionsChannel->fillInMissingMessages(msgs); }, [weak]() { auto shared = weak.lock();