X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcommon%2Fprotocols%2Flegacy%2Flegacypeer.h;h=ce960fa468b8fbeda10498d71241f1273c8e34aa;hb=f51494caaac1f102d5f28a026ccce871312ddd94;hp=718cc45bb61e758d97f39eb4e9e9bb5eff2130c6;hpb=9d54503555534a2c554f09a33df6afa33d6308ec;p=quassel.git diff --git a/src/common/protocols/legacy/legacypeer.h b/src/common/protocols/legacy/legacypeer.h index 718cc45b..ce960fa4 100644 --- a/src/common/protocols/legacy/legacypeer.h +++ b/src/common/protocols/legacy/legacypeer.h @@ -21,12 +21,8 @@ #ifndef LEGACYPEER_H #define LEGACYPEER_H -#include - #include "../../remotepeer.h" -class QDataStream; - class LegacyPeer : public RemotePeer { Q_OBJECT @@ -41,8 +37,10 @@ public: HeartBeatReply }; - LegacyPeer(AuthHandler *authHandler, QTcpSocket *socket, QObject *parent = 0); - ~LegacyPeer() {} + LegacyPeer(AuthHandler *authHandler, QTcpSocket *socket, Compressor::CompressionLevel level, QObject *parent = 0); + + Protocol::Type protocol() const { return Protocol::LegacyProtocol; } + QString protocolName() const { return "the legacy protocol"; } void setSignalProxy(SignalProxy *proxy); @@ -65,26 +63,24 @@ public: void dispatch(const Protocol::HeartBeat &msg); void dispatch(const Protocol::HeartBeatReply &msg); - // FIXME: this is only used for the auth phase and should be replaced by something more generic - void writeSocketData(const QVariant &item); - signals: void protocolError(const QString &errorString); // only used in compat mode void protocolVersionMismatch(int actual, int expected); -private slots: - void socketDataAvailable(); - private: - bool readSocketData(QVariant &item); + using RemotePeer::writeMessage; + void writeMessage(const QVariant &item); + void processMessage(const QByteArray &msg); + void handleHandshakeMessage(const QVariant &msg); void handlePackedFunc(const QVariant &packedFunc); void dispatchPackedFunc(const QVariantList &packedFunc); - QDataStream _stream; - qint32 _blockSize; + void toLegacyIrcUsersAndChannels(QVariantMap &initData); + void fromLegacyIrcUsersAndChannels(QVariantMap &initData); + bool _useCompression; };