Let RemotePeer(s) tell their protocol type and features
authorManuel Nickschas <sputnick@quassel-irc.org>
Thu, 23 Jan 2014 00:17:46 +0000 (01:17 +0100)
committerManuel Nickschas <sputnick@quassel-irc.org>
Thu, 23 Jan 2014 00:54:50 +0000 (01:54 +0100)
Knowing a peer's supported procotol type will come in handy once we
support more than one protocol. Also, peers may support specific
features which they can now report via the new accessor.

src/common/protocols/legacy/legacypeer.h
src/common/remotepeer.h

index d364c6c..1d09dd6 100644 (file)
@@ -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);
 
index 14d49f9..191439e 100644 (file)
@@ -42,11 +42,12 @@ public:
     using Peer::dispatch;
 
     RemotePeer(AuthHandler *authHandler, QTcpSocket *socket, QObject *parent = 0);
     using Peer::dispatch;
 
     RemotePeer(AuthHandler *authHandler, QTcpSocket *socket, QObject *parent = 0);
-    virtual ~RemotePeer() {};
 
     void setSignalProxy(SignalProxy *proxy);
 
 
     void setSignalProxy(SignalProxy *proxy);
 
-    QString description() const;
+    virtual Protocol::Type protocol() const = 0;
+    virtual QString description() const;
+    virtual quint16 enabledFeatures() const { return 0; }
 
     bool isOpen() const;
     bool isSecure() const;
 
     bool isOpen() const;
     bool isSecure() const;