X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Fclientsyncer.cpp;h=e0b502b69dd59ed23ae262993f6c7529fba80451;hp=a4a4be82a68bbb58bba5121af6e97097fac8715f;hb=d4b7af7050bac6f894a05bff4eab1becaffa27ce;hpb=2f600006c172342f253f1763620f5e635bc5b86f diff --git a/src/client/clientsyncer.cpp b/src/client/clientsyncer.cpp index a4a4be82..e0b502b6 100644 --- a/src/client/clientsyncer.cpp +++ b/src/client/clientsyncer.cpp @@ -20,7 +20,9 @@ #include "clientsyncer.h" -#include +#ifndef QT_NO_NETWORKPROXY +# include +#endif #include "client.h" #include "global.h" @@ -131,11 +133,12 @@ void ClientSyncer::connectToCore(const QVariantMap &conn) { } QTcpSocket *sock = new QTcpSocket(Client::instance()); #endif - +#ifndef QT_NO_NETWORKPROXY if(conn.contains("useProxy") && conn["useProxy"].toBool()) { QNetworkProxy proxy((QNetworkProxy::ProxyType)conn["proxyType"].toInt(), conn["proxyHost"].toString(), conn["proxyPort"].toUInt(), conn["proxyUser"].toString(), conn["proxyPassword"].toString()); sock->setProxy(proxy); } +#endif socket = sock; connect(sock, SIGNAL(readyRead()), this, SLOT(coreHasData())); connect(sock, SIGNAL(connected()), this, SLOT(coreSocketConnected())); @@ -154,10 +157,16 @@ void ClientSyncer::coreSocketConnected() { QVariantMap clientInit; clientInit["MsgType"] = "ClientInit"; clientInit["ClientVersion"] = Global::quasselVersion; - clientInit["ClientDate"] = Global::quasselDate; - clientInit["ClientBuild"] = Global::quasselBuild; // this is a minimum, since we probably won't update for every commit + clientInit["ClientBuild"] = 860; // FIXME legacy! + clientInit["ClientDate"] = Global::quasselBuildDate; + clientInit["ProtocolVersion"] = Global::protocolVersion; clientInit["UseSsl"] = coreConnectionInfo["useSsl"]; - +#ifndef QT_NO_COMPRESS + clientInit["UseCompression"] = true; +#else + clientInit["UseCompression"] = false; +#endif + SignalProxy::writeDataToDevice(socket, clientInit); } @@ -177,9 +186,10 @@ void ClientSyncer::coreSocketDisconnected() { void ClientSyncer::clientInitAck(const QVariantMap &msg) { // Core has accepted our version info and sent its own. Let's see if we accept it as well... - if(msg["CoreBuild"].toUInt() < Global::coreBuildNeeded) { + if((msg.contains("CoreBuild") && msg["CoreBuild"].toUInt() < 732) // legacy! + || (!msg.contains("CoreBuild") && msg["ProtocolVersion"].toUInt() < Global::clientNeedsProtocol)) { emit connectionError(tr("The Quassel Core you are trying to connect to is too old!
" - "Need at least a Core Version %1 (Build >= %2) to connect.").arg(Global::quasselVersion).arg(Global::coreBuildNeeded)); + "Need at least core/client protocol v%1 to connect.").arg(Global::clientNeedsProtocol)); disconnectFromCore(); return; } @@ -203,6 +213,12 @@ void ClientSyncer::clientInitAck(const QVariantMap &msg) { } #endif +#ifndef QT_NO_COMPRESS + if(msg["SupportsCompression"].toBool()) { + socket->setProperty("UseCompression", true); + } +#endif + if(!msg["Configured"].toBool()) { // start wizard emit startCoreSetup(msg["StorageBackends"].toList()); @@ -330,7 +346,8 @@ void ClientSyncer::ircUserRemoved(QObject *user) { } void ClientSyncer::checkSyncState() { - if(usersToSync.count() + channelsToSync.count() + netsToSync.count() == 0) { + // if(usersToSync.count() + channelsToSync.count() + netsToSync.count() == 0) { + if(netsToSync.isEmpty()) { // done syncing! /* qDebug() << "done";