Fixed subscriptions and announcements not being blockable (#4748)

* Check blocks for usernotices

* changelog

* cstd = {.name="C++20"}

* Update CHANGELOG.md

Co-authored-by: Felanbird <41973452+Felanbird@users.noreply.github.com>

---------

Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
Co-authored-by: Felanbird <41973452+Felanbird@users.noreply.github.com>
This commit is contained in:
Mm2PL 2023-08-05 14:45:43 +02:00 committed by GitHub
parent accf91a48f
commit 5727db2029
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 0 deletions

View file

@ -35,6 +35,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)

View file

@ -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<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
@ -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