X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Fclientauthhandler.cpp;h=0d24a761b11f95e91a2377c3db5b8cebf0514d65;hp=15efef36f31b5246d08fd3901172ee70db3c20c2;hb=0094d9ce512ca2e10500f079c489fc4c45970813;hpb=238fb432360269a5e31075b2a203967078a06231 diff --git a/src/client/clientauthhandler.cpp b/src/client/clientauthhandler.cpp index 15efef36..0d24a761 100644 --- a/src/client/clientauthhandler.cpp +++ b/src/client/clientauthhandler.cpp @@ -173,7 +173,7 @@ void ClientAuthHandler::onSocketConnected() if (_account.useSsl()) magic |= Protocol::Encryption; #endif - //magic |= Protocol::Compression; // not implemented yet + magic |= Protocol::Compression; stream << magic; @@ -195,7 +195,7 @@ void ClientAuthHandler::onSocketConnected() qDebug() << "Legacy core detected, switching to compatibility mode"; - RemotePeer *peer = PeerFactory::createPeer(PeerFactory::ProtoDescriptor(Protocol::LegacyProtocol, 0), this, socket(), this); + RemotePeer *peer = PeerFactory::createPeer(PeerFactory::ProtoDescriptor(Protocol::LegacyProtocol, 0), this, socket(), Compressor::NoCompression, this); // Only needed for the legacy peer, as all others check the protocol version before instantiation connect(peer, SIGNAL(protocolVersionMismatch(int,int)), SLOT(onProtocolVersionMismatch(int,int))); @@ -222,7 +222,13 @@ void ClientAuthHandler::onReadyRead() quint16 protoFeatures = static_cast(reply>>8 & 0xffff); _connectionFeatures = static_cast(reply>>24); - RemotePeer *peer = PeerFactory::createPeer(PeerFactory::ProtoDescriptor(type, protoFeatures), this, socket(), this); + Compressor::CompressionLevel level; + if (_connectionFeatures & Protocol::Compression) + level = Compressor::BestCompression; + else + level = Compressor::NoCompression; + + RemotePeer *peer = PeerFactory::createPeer(PeerFactory::ProtoDescriptor(type, protoFeatures), this, socket(), level, this); if (!peer) { qWarning() << "No valid protocol supported for this core!"; emit errorPopup(tr("Incompatible Quassel Core!
"