mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
Fix the reconnection backoff accidentally resetting when thrown out of certain IRC servers (#3328)
This commit is contained in:
parent
d7337ff69f
commit
4b903d7fcf
|
@ -44,6 +44,7 @@
|
||||||
- Bugfix: Fixed being unable to disable `First Message` highlights (#3293)
|
- 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` custom sound not persisting through restart. (#3303)
|
||||||
- Bugfix: Fixed `First Message` scrollbar highlights not being disabled. (#3325)
|
- 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)
|
- 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: 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)
|
- Dev: Renamed CMake's build option `USE_SYSTEM_QT5KEYCHAIN` to `USE_SYSTEM_QTKEYCHAIN`. (#3103)
|
||||||
|
|
|
@ -108,9 +108,12 @@ IrcConnection::IrcConnection(QObject *parent)
|
||||||
|
|
||||||
QObject::connect(this, &Communi::IrcConnection::messageReceived,
|
QObject::connect(this, &Communi::IrcConnection::messageReceived,
|
||||||
[this](Communi::IrcMessage *message) {
|
[this](Communi::IrcMessage *message) {
|
||||||
// This connection is probably still alive
|
|
||||||
this->recentlyReceivedMessage_ = true;
|
this->recentlyReceivedMessage_ = true;
|
||||||
this->reconnectBackoff_.reset();
|
|
||||||
|
if (message->command() == "372") // MOTD
|
||||||
|
{
|
||||||
|
this->reconnectBackoff_.reset();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,8 +30,8 @@ private:
|
||||||
QTimer reconnectTimer_;
|
QTimer reconnectTimer_;
|
||||||
std::atomic<bool> recentlyReceivedMessage_{true};
|
std::atomic<bool> recentlyReceivedMessage_{true};
|
||||||
|
|
||||||
// Reconnect with a base delay of 1 second and max out at 1 second * (2^4) (i.e. 16 seconds)
|
// Reconnect with a base delay of 1 second and max out at 1 second * (2^(5-1)) (i.e. 16 seconds)
|
||||||
ExponentialBackoff<4> reconnectBackoff_{std::chrono::milliseconds{1000}};
|
ExponentialBackoff<5> reconnectBackoff_{std::chrono::milliseconds{1000}};
|
||||||
|
|
||||||
std::atomic<bool> expectConnectionLoss_{false};
|
std::atomic<bool> expectConnectionLoss_{false};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue