From ae432afcff7d94f447eda8c1c4ef72d8b6e5f912 Mon Sep 17 00:00:00 2001 From: James Upjohn Date: Sun, 8 Aug 2021 23:44:34 +1200 Subject: [PATCH 1/7] feat(highlight): allow sub flagged messages to add to mentions channel --- src/providers/twitch/IrcMessageHandler.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/providers/twitch/IrcMessageHandler.cpp b/src/providers/twitch/IrcMessageHandler.cpp index 456d052234f..7c08038404b 100644 --- a/src/providers/twitch/IrcMessageHandler.cpp +++ b/src/providers/twitch/IrcMessageHandler.cpp @@ -313,12 +313,9 @@ void IrcMessageHandler::addMessage(Communi::IrcMessage *_message, const auto highlighted = msg->flags.has(MessageFlag::Highlighted); const auto showInMentions = msg->flags.has(MessageFlag::ShowInMentions); - if (!isSub) + if (highlighted && showInMentions) { - if (highlighted && showInMentions) - { - server.mentionsChannel->addMessage(msg); - } + server.mentionsChannel->addMessage(msg); } chan->addMessage(msg); From 3629d3528482138465516d9973957bd61ff40622 Mon Sep 17 00:00:00 2001 From: James Upjohn Date: Sun, 8 Aug 2021 23:45:54 +1200 Subject: [PATCH 2/7] feat(highlight): allow sub message highlighting to fall through --- src/messages/SharedMessageBuilder.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/messages/SharedMessageBuilder.cpp b/src/messages/SharedMessageBuilder.cpp index cdc8e59f0dd..c526dde17a0 100644 --- a/src/messages/SharedMessageBuilder.cpp +++ b/src/messages/SharedMessageBuilder.cpp @@ -157,10 +157,6 @@ void SharedMessageBuilder::parseHighlights() this->message().flags.set(MessageFlag::Highlighted); this->message().highlightColor = ColorProvider::instance().color(ColorType::Subscription); - - // This message was a subscription. - // Don't check for any other highlight phrases. - return; } // XXX: Non-common term in SharedMessageBuilder From 3990a73ebc33d741ef1efca39fd6947b7a2edd74 Mon Sep 17 00:00:00 2001 From: James Upjohn Date: Sun, 8 Aug 2021 23:46:56 +1200 Subject: [PATCH 3/7] fix(highlight): prevent sub highlight colour from being overridden --- src/messages/SharedMessageBuilder.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/messages/SharedMessageBuilder.cpp b/src/messages/SharedMessageBuilder.cpp index c526dde17a0..aac535db6e2 100644 --- a/src/messages/SharedMessageBuilder.cpp +++ b/src/messages/SharedMessageBuilder.cpp @@ -216,7 +216,8 @@ void SharedMessageBuilder::parseHighlights() << "sent a message"; this->message().flags.set(MessageFlag::Highlighted); - this->message().highlightColor = userHighlight.getColor(); + if (!this->message().flags.has(MessageFlag::Subscription)) + this->message().highlightColor = userHighlight.getColor(); if (userHighlight.showInMentions()) { @@ -285,7 +286,8 @@ void SharedMessageBuilder::parseHighlights() } this->message().flags.set(MessageFlag::Highlighted); - this->message().highlightColor = highlight.getColor(); + if (!this->message().flags.has(MessageFlag::Subscription)) + this->message().highlightColor = highlight.getColor(); if (highlight.showInMentions()) { @@ -340,7 +342,8 @@ void SharedMessageBuilder::parseHighlights() if (!badgeHighlightSet) { this->message().flags.set(MessageFlag::Highlighted); - this->message().highlightColor = highlight.getColor(); + if (!this->message().flags.has(MessageFlag::Subscription)) + this->message().highlightColor = highlight.getColor(); badgeHighlightSet = true; } From 87f708e95d9578534094348c8cd7cdce6f94448d Mon Sep 17 00:00:00 2001 From: James Upjohn Date: Sun, 8 Aug 2021 23:48:44 +1200 Subject: [PATCH 4/7] chore(changelog): add entry for #1013 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d864f1d7d5..eb6d046be1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - Minor: Remove TwitchEmotes.com attribution and the open/copy options when right-clicking a Twitch Emote. (#2214, #3136) - Bugfix: Moderation mode and active filters are now preserved when opening a split as a popup. (#3113, #3130) - Bugfix: Fixed a bug that caused all badge highlights to use the same color. (#3132, #3134) +- Bugfix: Allow resub messages to show in `/mentions` tab (#1013, #TODO) - Dev: Renamed CMake's build option `USE_SYSTEM_QT5KEYCHAIN` to `USE_SYSTEM_QTKEYCHAIN`. (#3103) ## 2.3.4 From 9e9d4bb7e85e5c6e945434aa540e8d15dc122400 Mon Sep 17 00:00:00 2001 From: James Upjohn Date: Sun, 8 Aug 2021 23:53:00 +1200 Subject: [PATCH 5/7] chore(changelog): update new entry PR number --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eb6d046be1e..a786598253d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ - Minor: Remove TwitchEmotes.com attribution and the open/copy options when right-clicking a Twitch Emote. (#2214, #3136) - Bugfix: Moderation mode and active filters are now preserved when opening a split as a popup. (#3113, #3130) - Bugfix: Fixed a bug that caused all badge highlights to use the same color. (#3132, #3134) -- Bugfix: Allow resub messages to show in `/mentions` tab (#1013, #TODO) +- Bugfix: Allow resub messages to show in `/mentions` tab (#1013, #3148) - Dev: Renamed CMake's build option `USE_SYSTEM_QT5KEYCHAIN` to `USE_SYSTEM_QTKEYCHAIN`. (#3103) ## 2.3.4 From 555237c490bff5a7ebe5c67afe86721dab3a8145 Mon Sep 17 00:00:00 2001 From: James Upjohn Date: Mon, 9 Aug 2021 00:09:30 +1200 Subject: [PATCH 6/7] chore(highlight): add curly braces to if statements --- src/messages/SharedMessageBuilder.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/messages/SharedMessageBuilder.cpp b/src/messages/SharedMessageBuilder.cpp index aac535db6e2..3af860f9fa9 100644 --- a/src/messages/SharedMessageBuilder.cpp +++ b/src/messages/SharedMessageBuilder.cpp @@ -217,7 +217,9 @@ void SharedMessageBuilder::parseHighlights() this->message().flags.set(MessageFlag::Highlighted); if (!this->message().flags.has(MessageFlag::Subscription)) + { this->message().highlightColor = userHighlight.getColor(); + } if (userHighlight.showInMentions()) { @@ -287,7 +289,9 @@ void SharedMessageBuilder::parseHighlights() this->message().flags.set(MessageFlag::Highlighted); if (!this->message().flags.has(MessageFlag::Subscription)) + { this->message().highlightColor = highlight.getColor(); + } if (highlight.showInMentions()) { @@ -343,7 +347,10 @@ void SharedMessageBuilder::parseHighlights() { this->message().flags.set(MessageFlag::Highlighted); if (!this->message().flags.has(MessageFlag::Subscription)) + { this->message().highlightColor = highlight.getColor(); + } + badgeHighlightSet = true; } From e972e6a10b20ab62d5ad03ec74687af582517584 Mon Sep 17 00:00:00 2001 From: James Upjohn Date: Sun, 15 Aug 2021 22:02:29 +1200 Subject: [PATCH 7/7] chore(changelog): change type of changelog entry to 'Minor' --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f76afd4b26..2c0a4dca83d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,10 +5,10 @@ - Minor: Remove TwitchEmotes.com attribution and the open/copy options when right-clicking a Twitch Emote. (#2214, #3136) - Minor: Strip leading @ and trailing , from username in /user and /usercard commands. (#3143) - Minor: Display a system message when reloading subscription emotes to match BTTV/FFZ behavior (#3135) +- Minor: Allow resub messages to show in `/mentions` tab (#3148) - Bugfix: Notifications for moderators about other moderators deleting messages can now be disabled. (#3121) - Bugfix: Moderation mode and active filters are now preserved when opening a split as a popup. (#3113, #3130) - Bugfix: Fixed a bug that caused all badge highlights to use the same color. (#3132, #3134) -- Bugfix: Allow resub messages to show in `/mentions` tab (#1013, #3148) - Dev: Renamed CMake's build option `USE_SYSTEM_QT5KEYCHAIN` to `USE_SYSTEM_QTKEYCHAIN`. (#3103) - Dev: Add benchmarks that can be compiled with the `BUILD_BENCHMARKS` CMake flag. Off by default. (#3038)