src: Yearly copyright bump
[quassel.git] / src / common / protocols / datastream / datastreampeer.h
index d11b618..c9dc227 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2005-2014 by the Quassel Project                        *
+ *   Copyright (C) 2005-2019 by the Quassel Project                        *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
@@ -21,8 +21,6 @@
 #ifndef DATASTREAMPEER_H
 #define DATASTREAMPEER_H
 
-#include <QDataStream>
-
 #include "../../remotepeer.h"
 
 class QDataStream;
@@ -41,16 +39,15 @@ public:
         HeartBeatReply
     };
 
-    DataStreamPeer(AuthHandler *authHandler, QTcpSocket *socket, quint16 features, QObject *parent = 0);
+    DataStreamPeer(AuthHandler *authHandler, QTcpSocket *socket, quint16 features, Compressor::CompressionLevel level, QObject *parent = 0);
 
     Protocol::Type protocol() const { return Protocol::DataStreamProtocol; }
+    QString protocolName() const { return "the DataStream protocol"; }
 
     static quint16 supportedFeatures();
     static bool acceptsFeatures(quint16 peerFeatures);
     quint16 enabledFeatures() const;
 
-    void setSignalProxy(SignalProxy *proxy);
-
     void dispatch(const Protocol::RegisterClient &msg);
     void dispatch(const Protocol::ClientDenied &msg);
     void dispatch(const Protocol::ClientRegistered &msg);
@@ -73,19 +70,15 @@ public:
 signals:
     void protocolError(const QString &errorString);
 
-protected slots:
-    void onSocketDataAvailable();
-
 private:
-    bool readSocketData(QVariant &item);
-    void writeSocketData(const QVariant &item);
-    void handleHandshakeMessage(const QVariant &msg);
-    void handlePackedFunc(const QVariant &packedFunc);
-    void dispatchPackedFunc(const QVariantList &packedFunc);
+    using RemotePeer::writeMessage;
+    void writeMessage(const QVariantMap &handshakeMsg);
+    void writeMessage(const QVariantList &sigProxyMsg);
+    void processMessage(const QByteArray &msg);
 
-    QDataStream _stream;
-    quint32 _blockSize;
-    bool _useCompression;
+    void handleHandshakeMessage(const QVariantList &mapData);
+    void handlePackedFunc(const QVariantList &packedFunc);
+    void dispatchPackedFunc(const QVariantList &packedFunc);
 };
 
 #endif