_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()));
setConnectionState(Network::Initialized);
network()->setConnected(true);
emit connected(networkId());
-
+ sendWho();
+ _whoTimer.start();
}
void NetworkConnection::sendPerform() {
}
void NetworkConnection::socketDisconnected() {
+ _whoTimer.stop();
network()->setConnected(false);
emit disconnected(networkId());
if(_autoReconnectCount == 0) emit quitRequested(networkId());
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;