#ifndef LEGACYPEER_H
#define LEGACYPEER_H
-#include <QDataStream>
-
#include "../../remotepeer.h"
-class QDataStream;
-
class LegacyPeer : public RemotePeer
{
Q_OBJECT
HeartBeatReply
};
- LegacyPeer(AuthHandler *authHandler, QTcpSocket *socket, QObject *parent = 0);
+ 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);
// only used in compat mode
void protocolVersionMismatch(int actual, int expected);
-protected slots:
- void onSocketDataAvailable();
-
private:
- bool readSocketData(QVariant &item);
- void writeSocketData(const 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);
void toLegacyIrcUsersAndChannels(QVariantMap &initData);
void fromLegacyIrcUsersAndChannels(QVariantMap &initData);
- QDataStream _stream;
- quint32 _blockSize;
bool _useCompression;
};