From e6c081bb1af18389ff7800bf2d4e2ffc91674777 Mon Sep 17 00:00:00 2001 From: Mm2PL Date: Thu, 3 Aug 2023 20:20:24 +0200 Subject: [PATCH 1/4] Check blocks for usernotices --- src/providers/twitch/IrcMessageHandler.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/providers/twitch/IrcMessageHandler.cpp b/src/providers/twitch/IrcMessageHandler.cpp index a5e81c01cf3..d40c1c3433a 100644 --- a/src/providers/twitch/IrcMessageHandler.cpp +++ b/src/providers/twitch/IrcMessageHandler.cpp @@ -4,6 +4,7 @@ #include "common/Literals.hpp" #include "common/QLogging.hpp" #include "controllers/accounts/AccountController.hpp" +#include "controllers/ignores/IgnoreController.hpp" #include "messages/LimitedQueue.hpp" #include "messages/Link.hpp" #include "messages/Message.hpp" @@ -892,6 +893,16 @@ std::vector IrcMessageHandler::parseUserNoticeMessage( content = parameters[1]; } + if (isIgnoredMessage({ + /*.message = */ content, + /*.twitchUserID = */ tags.value("user-id").toString(), + /*.isMod = */ channel->isMod(), + /*.isBroadcaster = */ channel->isBroadcaster(), + })) + { + return {}; + } + if (specialMessageTypes.contains(msgType)) { // Messages are not required, so they might be empty @@ -953,6 +964,17 @@ void IrcMessageHandler::handleUserNoticeMessage(Communi::IrcMessage *message, content = parameters[1]; } + auto chn = server.getChannelOrEmpty(target); + if (isIgnoredMessage({ + /*.message = */ content, + /*.twitchUserID = */ tags.value("user-id").toString(), + /*.isMod = */ chn->isMod(), + /*.isBroadcaster = */ chn->isBroadcaster(), + })) + { + return; + } + if (specialMessageTypes.contains(msgType)) { // Messages are not required, so they might be empty From 65da96f556ce31abf212a41ddc46cf800986d104 Mon Sep 17 00:00:00 2001 From: Mm2PL Date: Thu, 3 Aug 2023 20:31:31 +0200 Subject: [PATCH 2/4] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f8c817dcf5..5c5846331c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ - Bugfix: Fixed highlights sometimes not working after changing sound device, or switching users in your operating system. (#4729) - Bugfix: Fixed key bindings not showing in context menus on Mac. (#4722) - Bugfix: Fixed tab completion rarely completing the wrong word. (#4735) +- Bugfix: Fixed subscriptions and announcements not being blockable (#4748) - Dev: Added command to set Qt's logging filter/rules at runtime (`/c2-set-logging-rules`). (#4637) - Dev: Added the ability to see & load custom themes from the Themes directory. No stable promises are made of this feature, changes might be made that breaks custom themes without notice. (#4570) - Dev: Added test cases for emote and tab completion. (#4644) From 96d0e4d8682b37dc11aefd8c15341db2b644db6a Mon Sep 17 00:00:00 2001 From: Mm2PL Date: Thu, 3 Aug 2023 20:32:46 +0200 Subject: [PATCH 3/4] cstd = {.name="C++20"} --- src/providers/twitch/IrcMessageHandler.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/providers/twitch/IrcMessageHandler.cpp b/src/providers/twitch/IrcMessageHandler.cpp index d40c1c3433a..fa3cbaf7bf5 100644 --- a/src/providers/twitch/IrcMessageHandler.cpp +++ b/src/providers/twitch/IrcMessageHandler.cpp @@ -894,10 +894,10 @@ std::vector IrcMessageHandler::parseUserNoticeMessage( } if (isIgnoredMessage({ - /*.message = */ content, - /*.twitchUserID = */ tags.value("user-id").toString(), - /*.isMod = */ channel->isMod(), - /*.isBroadcaster = */ channel->isBroadcaster(), + .message = content, + .twitchUserID = tags.value("user-id").toString(), + .isMod = channel->isMod(), + .isBroadcaster = channel->isBroadcaster(), })) { return {}; @@ -966,10 +966,10 @@ void IrcMessageHandler::handleUserNoticeMessage(Communi::IrcMessage *message, auto chn = server.getChannelOrEmpty(target); if (isIgnoredMessage({ - /*.message = */ content, - /*.twitchUserID = */ tags.value("user-id").toString(), - /*.isMod = */ chn->isMod(), - /*.isBroadcaster = */ chn->isBroadcaster(), + .message = content, + .twitchUserID = tags.value("user-id").toString(), + .isMod = chn->isMod(), + .isBroadcaster = chn->isBroadcaster(), })) { return; From e599761b323a13b7d7f4263ef6330e8fa24255b0 Mon Sep 17 00:00:00 2001 From: pajlada Date: Sat, 5 Aug 2023 13:46:20 +0200 Subject: [PATCH 4/4] Update CHANGELOG.md Co-authored-by: Felanbird <41973452+Felanbird@users.noreply.github.com> --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c5846331c3..14322dc01af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,7 +31,7 @@ - Bugfix: Fixed highlights sometimes not working after changing sound device, or switching users in your operating system. (#4729) - Bugfix: Fixed key bindings not showing in context menus on Mac. (#4722) - Bugfix: Fixed tab completion rarely completing the wrong word. (#4735) -- Bugfix: Fixed subscriptions and announcements not being blockable (#4748) +- Bugfix: Fixed an issue where Subscriptions & Announcements that contained ignored phrases would still appear if the Block option was enabled. (#4748) - Dev: Added command to set Qt's logging filter/rules at runtime (`/c2-set-logging-rules`). (#4637) - Dev: Added the ability to see & load custom themes from the Themes directory. No stable promises are made of this feature, changes might be made that breaks custom themes without notice. (#4570) - Dev: Added test cases for emote and tab completion. (#4644)