Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed subscriptions and announcements not being blockable #4748

Merged
merged 4 commits into from
Aug 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 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)
Expand Down
22 changes: 22 additions & 0 deletions src/providers/twitch/IrcMessageHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -892,6 +893,16 @@ std::vector<MessagePtr> 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
Expand Down Expand Up @@ -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
Expand Down
Loading