X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fnetworkconnection.cpp;h=e56bb93378f2c09d33560434ba7c35b52abe26a4;hp=651a1bea9dc0875d88d88822a4bdcb2a95f621c1;hb=c0bbc724cda7acf652d9d2ce80605ebb53c4a2ff;hpb=cb8e83ba5b400cf6957b92b3fc511c5e8369f0ee diff --git a/src/core/networkconnection.cpp b/src/core/networkconnection.cpp index 651a1bea..e56bb933 100644 --- a/src/core/networkconnection.cpp +++ b/src/core/networkconnection.cpp @@ -46,7 +46,13 @@ NetworkConnection::NetworkConnection(Network *network, CoreSession *session) : Q _autoReconnectCount(0) { _autoReconnectTimer.setSingleShot(true); + + // TODO make configurable + _whoTimer.setInterval(60 * 1000); + _whoTimer.setSingleShot(false); + connect(&_autoReconnectTimer, SIGNAL(timeout()), this, SLOT(doAutoReconnect())); + connect(&_whoTimer, SIGNAL(timeout()), this, SLOT(sendWho())); connect(network, SIGNAL(currentServerSet(const QString &)), this, SLOT(networkInitialized(const QString &))); connect(network, SIGNAL(useAutoReconnectSet(bool)), this, SLOT(autoReconnectSettingsChanged())); @@ -204,7 +210,8 @@ void NetworkConnection::networkInitialized(const QString ¤tServer) { setConnectionState(Network::Initialized); network()->setConnected(true); emit connected(networkId()); - + sendWho(); + _whoTimer.start(); } void NetworkConnection::sendPerform() { @@ -294,6 +301,7 @@ void NetworkConnection::socketStateChanged(QAbstractSocket::SocketState socketSt } void NetworkConnection::socketDisconnected() { + _whoTimer.stop(); network()->setConnected(false); emit disconnected(networkId()); if(_autoReconnectCount == 0) emit quitRequested(networkId()); @@ -338,6 +346,12 @@ void NetworkConnection::putCmd(const QString &cmd, const QVariantList ¶ms, c putRawLine(msg); } +void NetworkConnection::sendWho() { + foreach(QString chan, network()->channels()) { + putRawLine("WHO " + serverEncode(chan)); + } +} + void NetworkConnection::addChannelKey(const QString &channel, const QString &key) { if(key.isEmpty()) removeChannelKey(channel); else _channelKeys[channel] = key;