From 83c00453da17f1ef4d37a5de05e8ea8c94e31127 Mon Sep 17 00:00:00 2001 From: 2547techno Date: Sat, 25 Mar 2023 03:53:46 -0400 Subject: [PATCH] added messages in mentions tab if correct predicate is met --- CHANGELOG.md | 1 + src/providers/twitch/TwitchChannel.cpp | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a79b0c3163c..2dd280deb5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - Minor: Include normally-stripped mention in replies in logs. (#4420) - Minor: Added support for FrankerFaceZ animated emotes. (#4434) - Minor: Added a local backup of the Twitch Badges API in case the request fails. (#4463) +- Minor: Populate "mentions" tab with messages from history (#4475) - Bugfix: Fixed an issue where animated emotes would render on top of zero-width emotes. (#4314) - Bugfix: Fixed an issue where it was difficult to hover a zero-width emote. (#4314) - Bugfix: Fixed an issue where context-menu items for zero-width emotes displayed the wrong provider. (#4460) diff --git a/src/providers/twitch/TwitchChannel.cpp b/src/providers/twitch/TwitchChannel.cpp index 89972c8d023..2c3af8b31cf 100644 --- a/src/providers/twitch/TwitchChannel.cpp +++ b/src/providers/twitch/TwitchChannel.cpp @@ -1117,6 +1117,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()->getTwitch()->mentionsChannel->fillInMissingMessages(msgs); }, [weak]() { auto shared = weak.lock();