fix: stop blocked terms from showing up more than once (#5789)

This commit is contained in:
pajlada
2025-01-04 12:57:09 +01:00
committed by GitHub
parent 5aab424a6a
commit 8b7d7f9d71
4 changed files with 11 additions and 6 deletions
+6 -4
View File
@@ -495,12 +495,12 @@ void TwitchIrcServer::initialize()
PubSubAutoModQueueMessage::Reason::BlockedTerm)
{
auto numBlockedTermsMatched =
msg.blockedTermsFound.count();
msg.blockedTermsFound.size();
auto hideBlockedTerms =
getSettings()
->streamerModeHideBlockedTermText &&
getApp()->getStreamerMode()->isEnabled();
if (!msg.blockedTermsFound.isEmpty())
if (!msg.blockedTermsFound.empty())
{
if (hideBlockedTerms)
{
@@ -513,14 +513,16 @@ void TwitchIrcServer::initialize()
}
else
{
QStringList blockedTerms(
msg.blockedTermsFound.begin(),
msg.blockedTermsFound.end());
action.reason =
u"matches %1 blocked term%2 \"%3\""_s
.arg(numBlockedTermsMatched)
.arg(numBlockedTermsMatched > 1
? u"s"
: u"")
.arg(msg.blockedTermsFound.join(
u"\", \""));
.arg(blockedTerms.join(u"\", \""));
}
}
else