clean up reason generation

This commit is contained in:
Rasmus Karlsson 2024-11-06 17:14:32 +01:00
parent 12fa816564
commit 1199f5e763
No known key found for this signature in database

View file

@ -149,6 +149,8 @@ bool shouldSendHelixChat()
namespace chatterino { namespace chatterino {
using namespace literals;
TwitchIrcServer::TwitchIrcServer() TwitchIrcServer::TwitchIrcServer()
: whispersChannel(new Channel("/whispers", Channel::Type::TwitchWhispers)) : whispersChannel(new Channel("/whispers", Channel::Type::TwitchWhispers))
, mentionsChannel(new Channel("/mentions", Channel::Type::TwitchMentions)) , mentionsChannel(new Channel("/mentions", Channel::Type::TwitchMentions))
@ -504,25 +506,21 @@ void TwitchIrcServer::initialize()
if (hideBlockedTerms) if (hideBlockedTerms)
{ {
action.reason = action.reason =
u"matched " % u"matches %1 blocked term%2"_s.arg(
QString::number( numBlockedTermsMatched,
numBlockedTermsMatched) % numBlockedTermsMatched > 1 ? 's'
u" blocked term" % : "");
(numBlockedTermsMatched > 1 ? u"s"
: u"");
} }
else else
{ {
action.reason = action.reason =
u"matched " % u"matches %1 blocked term%2 \"%3\""_s
QString::number( .arg(numBlockedTermsMatched,
numBlockedTermsMatched) % numBlockedTermsMatched > 1
u" blocked term" % ? 's'
(numBlockedTermsMatched > 1 ? u"s" : "",
: u"") % msg.blockedTermsFound.join(
u": \"" % u"\", \""));
msg.blockedTermsFound.join(u"\", \"") %
u"\"";
} }
} }
else else