Let RemotePeer(s) tell their protocol type and features
[quassel.git] / src / common / protocols / legacy / legacypeer.h
index 9234b33..1d09dd6 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
 /***************************************************************************
- *   Copyright (C) 2005-2013 by the Quassel Project                        *
+ *   Copyright (C) 2005-2014 by the Quassel Project                        *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
@@ -42,7 +42,8 @@ public:
     };
 
     LegacyPeer(AuthHandler *authHandler, QTcpSocket *socket, QObject *parent = 0);
     };
 
     LegacyPeer(AuthHandler *authHandler, QTcpSocket *socket, QObject *parent = 0);
-    ~LegacyPeer() {}
+
+    Protocol::Type protocol() const { return Protocol::LegacyProtocol; }
 
     void setSignalProxy(SignalProxy *proxy);
 
 
     void setSignalProxy(SignalProxy *proxy);
 
@@ -74,8 +75,8 @@ signals:
     // only used in compat mode
     void protocolVersionMismatch(int actual, int expected);
 
     // only used in compat mode
     void protocolVersionMismatch(int actual, int expected);
 
-private slots:
-    void socketDataAvailable();
+protected slots:
+    void onSocketDataAvailable();
 
 private:
     bool readSocketData(QVariant &item);
 
 private:
     bool readSocketData(QVariant &item);
@@ -84,7 +85,7 @@ private:
     void dispatchPackedFunc(const QVariantList &packedFunc);
 
     QDataStream _stream;
     void dispatchPackedFunc(const QVariantList &packedFunc);
 
     QDataStream _stream;
-    qint32 _blockSize;
+    quint32 _blockSize;
     bool _useCompression;
 };
 
     bool _useCompression;
 };