Fix CoreFeatures; disable SASL support if core isn't new enough
[quassel.git] / src / client / coreconnection.cpp
index 59d3f8f..f523914 100644 (file)
@@ -45,6 +45,12 @@ CoreConnection::CoreConnection(CoreAccountModel *model, QObject *parent)
   _progressValue(-1)
 {
   qRegisterMetaType<ConnectionState>("CoreConnection::ConnectionState");
+}
+
+void CoreConnection::init() {
+  Client::signalProxy()->setHeartBeatInterval(30);
+  connect(Client::signalProxy(), SIGNAL(disconnected()), SLOT(coreSocketDisconnected()));
+  connect(Client::signalProxy(), SIGNAL(lagUpdated(int)), SIGNAL(lagUpdated(int)));
 
   _reconnectTimer.setSingleShot(true);
   connect(&_reconnectTimer, SIGNAL(timeout()), SLOT(reconnectTimeout()));
@@ -53,11 +59,6 @@ CoreConnection::CoreConnection(CoreAccountModel *model, QObject *parent)
   connect(Solid::Networking::notifier(), SIGNAL(statusChanged(Solid::Networking::Status)),
           SLOT(solidNetworkStatusChanged(Solid::Networking::Status)));
 #endif
-}
-
-void CoreConnection::init() {
-  Client::signalProxy()->setHeartBeatInterval(30);
-  connect(Client::signalProxy(), SIGNAL(disconnected()), SLOT(coreSocketDisconnected()));
 
   CoreConnectionSettings s;
   s.initAndNotify("PingTimeoutInterval", this, SLOT(pingTimeoutIntervalChanged(QVariant)), 60);
@@ -336,6 +337,7 @@ void CoreConnection::resetConnection(bool wantReconnect) {
 
   setProgressMaximum(-1); // disable
   setState(Disconnected);
+  emit lagUpdated(-1);
 
   emit connectionMsg(tr("Disconnected from core."));
   emit encrypted(false);
@@ -472,6 +474,8 @@ void CoreConnection::clientInitAck(const QVariantMap &msg) {
     return;
   }
 
+  Client::setCoreFeatures((Quassel::Features)msg["CoreFeatures"].toUInt());
+
 #ifndef QT_NO_COMPRESS
   if(msg["SupportsCompression"].toBool()) {
     _socket->setProperty("UseCompression", true);