#include "ircchannel.h"
#include "ircuser.h"
-#include "network.h"
#include "identity.h"
#include "ircserverhandler.h"
_autoReconnectTimer.setSingleShot(true);
_socketCloseTimer.setSingleShot(true);
connect(&_socketCloseTimer, SIGNAL(timeout()), this, SLOT(socketCloseTimeout()));
-
+
+ _pingTimer.setInterval(60000);
+ connect(&_pingTimer, SIGNAL(timeout()), this, SLOT(sendPing()));
+
_autoWhoTimer.setInterval(_autoWhoDelay * 1000);
_autoWhoCycleTimer.setInterval(_autoWhoInterval * 1000);
network()->setConnected(true);
emit connected(networkId());
+ _pingTimer.start();
+
if(_autoWhoEnabled) {
_autoWhoCycleTimer.start();
_autoWhoTimer.start();
}
void NetworkConnection::socketDisconnected() {
+ _pingTimer.stop();
_autoWhoCycleTimer.stop();
_autoWhoTimer.stop();
_autoWhoQueue.clear();
putRawLine(msg);
}
+void NetworkConnection::sendPing() {
+ userInputHandler()->handlePing(BufferInfo(), QString());
+}
+
void NetworkConnection::sendAutoWho() {
while(!_autoWhoQueue.isEmpty()) {
QString chan = _autoWhoQueue.takeFirst();