#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);
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);
-protected slots:
- void onSocketDataAvailable();
-
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;
- quint32 _blockSize;
+ void toLegacyIrcUsersAndChannels(QVariantMap &initData);
+ void fromLegacyIrcUsersAndChannels(QVariantMap &initData);
+
bool _useCompression;
};