2019-09-08 22:27:57 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <pajlada/signals/signal.hpp>
|
|
|
|
|
|
|
|
#include <IrcConnection>
|
|
|
|
#include <QTimer>
|
|
|
|
|
|
|
|
namespace chatterino {
|
|
|
|
|
|
|
|
class IrcConnection : public Communi::IrcConnection
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
IrcConnection(QObject *parent = nullptr);
|
|
|
|
|
|
|
|
pajlada::Signals::NoArgSignal reconnectRequested;
|
|
|
|
|
|
|
|
private:
|
|
|
|
QTimer pingTimer_;
|
|
|
|
QTimer reconnectTimer_;
|
|
|
|
std::atomic<bool> recentlyReceivedMessage_{true};
|
2020-01-03 20:55:13 +01:00
|
|
|
|
|
|
|
// waitingForPong_ is set to true when we send a PING message, and back to false when we receive the matching PONG response
|
|
|
|
std::atomic<bool> waitingForPong_{false};
|
2019-09-08 22:27:57 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace chatterino
|