X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcore%2Fnetworkconnection.cpp;h=e4cc3aa5c859391bab4e013aa42ad60ddec21737;hb=72661d39517f5a06862abfe4e645f64334041cb4;hp=f5e6a367b04a3d58973b03a3c7a209a8bfd9b8c9;hpb=c30f8eb1f1d360284b38016655cdb6a3e40db8ed;p=quassel.git diff --git a/src/core/networkconnection.cpp b/src/core/networkconnection.cpp index f5e6a367..e4cc3aa5 100644 --- a/src/core/networkconnection.cpp +++ b/src/core/networkconnection.cpp @@ -64,7 +64,10 @@ NetworkConnection::NetworkConnection(Network *network, CoreSession *session) _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); @@ -215,6 +218,8 @@ void NetworkConnection::networkInitialized(const QString ¤tServer) { network()->setConnected(true); emit connected(networkId()); + _pingTimer.start(); + if(_autoWhoEnabled) { _autoWhoCycleTimer.start(); _autoWhoTimer.start(); @@ -370,6 +375,7 @@ void NetworkConnection::socketCloseTimeout() { } void NetworkConnection::socketDisconnected() { + _pingTimer.stop(); _autoWhoCycleTimer.stop(); _autoWhoTimer.stop(); _autoWhoQueue.clear(); @@ -502,6 +508,10 @@ void NetworkConnection::putCmd(const QString &cmd, const QList ¶ putRawLine(msg); } +void NetworkConnection::sendPing() { + userInputHandler()->handlePing(BufferInfo(), QString()); +} + void NetworkConnection::sendAutoWho() { while(!_autoWhoQueue.isEmpty()) { QString chan = _autoWhoQueue.takeFirst();