From efde73e6840791b68f2f8eaa5bcf3031f74f273d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82?= Date: Sun, 7 Mar 2021 18:03:53 +0100 Subject: [PATCH] Fixed remaining timeout message (#2502) --- src/providers/twitch/IrcMessageHandler.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/providers/twitch/IrcMessageHandler.cpp b/src/providers/twitch/IrcMessageHandler.cpp index e2f39bda9..6b7eeb71a 100644 --- a/src/providers/twitch/IrcMessageHandler.cpp +++ b/src/providers/twitch/IrcMessageHandler.cpp @@ -719,16 +719,18 @@ std::vector IrcMessageHandler::parseNoticeMessage( } else if (message->tags()["msg-id"] == "msg_timedout") { - std::vector builtMessages; + std::vector builtMessage; - QString formattedMessage = "You are timed out for "; - formattedMessage.append( - formatTime(message->content().split(" ").value(5))); + QString remainingTime = + formatTime(message->content().split(" ").value(5)); + QString formattedMessage = + QString("You are timed out for %1.") + .arg(remainingTime.isEmpty() ? "0s" : remainingTime); - builtMessages.emplace_back(makeSystemMessage( - formattedMessage.append("."), calculateMessageTimestamp(message))); + builtMessage.emplace_back(makeSystemMessage( + formattedMessage, calculateMessageTimestamp(message))); - return builtMessages; + return builtMessage; } else {