diff --git a/CHANGELOG.md b/CHANGELOG.md index 8fbd0341..5bf1bcbb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,7 @@ - Bugfix: Fixed being unable to disable `First Message` highlights (#3293) - Bugfix: Fixed `First Message` custom sound not persisting through restart. (#3303) - Bugfix: Fixed `First Message` scrollbar highlights not being disabled. (#3325) +- Bugfix: Fixed the reconnection backoff accidentally resetting when thrown out of certain IRC servers. (#3328) - Bugfix: Fixed underlying text from disabled emotes not being colorized properly. (#3333) - Dev: Add GitHub action to test builds without precompiled headers enabled. (#3327) - Dev: Renamed CMake's build option `USE_SYSTEM_QT5KEYCHAIN` to `USE_SYSTEM_QTKEYCHAIN`. (#3103) diff --git a/src/providers/irc/IrcConnection2.cpp b/src/providers/irc/IrcConnection2.cpp index ff52fa84..152d71a2 100644 --- a/src/providers/irc/IrcConnection2.cpp +++ b/src/providers/irc/IrcConnection2.cpp @@ -108,9 +108,12 @@ IrcConnection::IrcConnection(QObject *parent) QObject::connect(this, &Communi::IrcConnection::messageReceived, [this](Communi::IrcMessage *message) { - // This connection is probably still alive this->recentlyReceivedMessage_ = true; - this->reconnectBackoff_.reset(); + + if (message->command() == "372") // MOTD + { + this->reconnectBackoff_.reset(); + } }); } diff --git a/src/providers/irc/IrcConnection2.hpp b/src/providers/irc/IrcConnection2.hpp index d3426c02..261d172f 100644 --- a/src/providers/irc/IrcConnection2.hpp +++ b/src/providers/irc/IrcConnection2.hpp @@ -30,8 +30,8 @@ private: QTimer reconnectTimer_; std::atomic recentlyReceivedMessage_{true}; - // Reconnect with a base delay of 1 second and max out at 1 second * (2^4) (i.e. 16 seconds) - ExponentialBackoff<4> reconnectBackoff_{std::chrono::milliseconds{1000}}; + // Reconnect with a base delay of 1 second and max out at 1 second * (2^(5-1)) (i.e. 16 seconds) + ExponentialBackoff<5> reconnectBackoff_{std::chrono::milliseconds{1000}}; std::atomic expectConnectionLoss_{false};