Added formatting for remaining timeout duration (#2398)

This commit is contained in:
M4tthewDE 2021-01-31 13:55:44 +01:00 committed by GitHub
parent 8cd923b8fb
commit c2782666a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 0 deletions

View file

@ -49,6 +49,7 @@
- Minor: Made username autocompletion truecase (#1199, #1883) - Minor: Made username autocompletion truecase (#1199, #1883)
- Minor: Update the listing of top-level domains. (#2345) - Minor: Update the listing of top-level domains. (#2345)
- Minor: Properly respect RECONNECT messages from Twitch (#2347) - Minor: Properly respect RECONNECT messages from Twitch (#2347)
- Minor: Added human-readable formatting to remaining timeout duration. (#2398)
- Bugfix: Fix crash occurring when pressing Escape in the Color Picker Dialog (#1843) - Bugfix: Fix crash occurring when pressing Escape in the Color Picker Dialog (#1843)
- Bugfix: Fix bug where the "check user follow state" event could trigger a network request requesting the user to follow or unfollow a user. By itself its quite harmless as it just repeats to Twitch the same follow state we had, so no follows should have been lost by this but it meant there was a rogue network request that was fired that could cause a crash (#1906) - Bugfix: Fix bug where the "check user follow state" event could trigger a network request requesting the user to follow or unfollow a user. By itself its quite harmless as it just repeats to Twitch the same follow state we had, so no follows should have been lost by this but it meant there was a rogue network request that was fired that could cause a crash (#1906)
- Bugfix: /usercard command will now respect the "Automatically close user popup" setting (#1918) - Bugfix: /usercard command will now respect the "Automatically close user popup" setting (#1918)

View file

@ -13,6 +13,7 @@
#include "singletons/Resources.hpp" #include "singletons/Resources.hpp"
#include "singletons/Settings.hpp" #include "singletons/Settings.hpp"
#include "singletons/WindowManager.hpp" #include "singletons/WindowManager.hpp"
#include "util/FormatTime.hpp"
#include "util/IrcHelpers.hpp" #include "util/IrcHelpers.hpp"
#include <IrcMessage> #include <IrcMessage>
@ -716,6 +717,19 @@ std::vector<MessagePtr> IrcMessageHandler::parseNoticeMessage(
{ {
return {generateBannedMessage(true)}; return {generateBannedMessage(true)};
} }
else if (message->tags()["msg-id"] == "msg_timedout")
{
std::vector<MessagePtr> builtMessages;
QString formattedMessage = "You are timed out for ";
formattedMessage.append(
formatTime(message->content().split(" ").value(5)));
builtMessages.emplace_back(makeSystemMessage(
formattedMessage.append("."), calculateMessageTimestamp(message)));
return builtMessages;
}
else else
{ {
std::vector<MessagePtr> builtMessages; std::vector<MessagePtr> builtMessages;