From 1199f5e7637d35548cc605f9b07ac127ad07e798 Mon Sep 17 00:00:00 2001 From: Rasmus Karlsson Date: Wed, 6 Nov 2024 17:14:32 +0100 Subject: [PATCH] clean up reason generation --- src/providers/twitch/TwitchIrcServer.cpp | 28 +++++++++++------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/src/providers/twitch/TwitchIrcServer.cpp b/src/providers/twitch/TwitchIrcServer.cpp index 502900187..7a662671d 100644 --- a/src/providers/twitch/TwitchIrcServer.cpp +++ b/src/providers/twitch/TwitchIrcServer.cpp @@ -149,6 +149,8 @@ bool shouldSendHelixChat() namespace chatterino { +using namespace literals; + TwitchIrcServer::TwitchIrcServer() : whispersChannel(new Channel("/whispers", Channel::Type::TwitchWhispers)) , mentionsChannel(new Channel("/mentions", Channel::Type::TwitchMentions)) @@ -504,25 +506,21 @@ void TwitchIrcServer::initialize() if (hideBlockedTerms) { action.reason = - u"matched " % - QString::number( - numBlockedTermsMatched) % - u" blocked term" % - (numBlockedTermsMatched > 1 ? u"s" - : u""); + u"matches %1 blocked term%2"_s.arg( + numBlockedTermsMatched, + numBlockedTermsMatched > 1 ? 's' + : ""); } else { action.reason = - u"matched " % - QString::number( - numBlockedTermsMatched) % - u" blocked term" % - (numBlockedTermsMatched > 1 ? u"s" - : u"") % - u": \"" % - msg.blockedTermsFound.join(u"\", \"") % - u"\""; + u"matches %1 blocked term%2 \"%3\""_s + .arg(numBlockedTermsMatched, + numBlockedTermsMatched > 1 + ? 's' + : "", + msg.blockedTermsFound.join( + u"\", \"")); } } else