diff --git a/src/providers/twitch/ircmessagehandler.cpp b/src/providers/twitch/ircmessagehandler.cpp index 4c005991c..54ba23a8d 100644 --- a/src/providers/twitch/ircmessagehandler.cpp +++ b/src/providers/twitch/ircmessagehandler.cpp @@ -15,6 +15,8 @@ #include +#include + using namespace chatterino::singletons; using namespace chatterino::messages; @@ -324,17 +326,34 @@ void IrcMessageHandler::handleNoticeMessage(Communi::IrcNoticeMessage *message) void IrcMessageHandler::handleWriteConnectionNoticeMessage(Communi::IrcNoticeMessage *message) { + static std::unordered_set readConnectionOnlyIDs{ + "host_on", + "host_off", + "host_target_went_offline", + "emote_only_on", + "emote_only_off", + "slow_on", + "slow_off", + "subs_on", + "subs_off", + "r9k_on", + "r9k_off", + + // Display for user who times someone out. This implies you're a moderator, at which point + // you will be connected to PubSub and receive a better message from there + "timeout_success", + "ban_success", + }; + QVariant v = message->tag("msg-id"); - if (!v.isValid()) { - return; - } - QString msg_id = v.toString(); + if (v.isValid()) { + std::string msgID = v.toString().toStdString(); - static QList idsToSkip = {"timeout_success", "ban_success"}; + if (readConnectionOnlyIDs.find(msgID) != readConnectionOnlyIDs.end()) { + return; + } - if (idsToSkip.contains(msg_id)) { - // Already handled in the read-connection - return; + debug::Log("Showing notice message from write connection with message id '{}'", msgID); } this->handleNoticeMessage(message); diff --git a/src/providers/twitch/twitchserver.cpp b/src/providers/twitch/twitchserver.cpp index e367fa416..1fc3ee332 100644 --- a/src/providers/twitch/twitchserver.cpp +++ b/src/providers/twitch/twitchserver.cpp @@ -10,6 +10,7 @@ #include "util/posttothread.hpp" #include + #include // using namespace Communi;