X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcommon%2Fpeer.h;h=fbc17914889f244b7ab56bd842f48a51e2bccc02;hb=9f5158eab420977b42d8fc6b98d2eb0de66cbaa4;hp=6b824cfd2a2c57f02d4c5f4ea4d9ffc4468d4879;hpb=28cee4568aeb1ce3014d11234e40f19e7aeae5bd;p=quassel.git diff --git a/src/common/peer.h b/src/common/peer.h index 6b824cfd..fbc17914 100644 --- a/src/common/peer.h +++ b/src/common/peer.h @@ -18,8 +18,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef PEER_H -#define PEER_H +#pragma once #include #include @@ -27,6 +26,7 @@ #include "authhandler.h" #include "protocol.h" +#include "quassel.h" #include "signalproxy.h" class Peer : public QObject @@ -42,15 +42,18 @@ public: virtual SignalProxy *signalProxy() const = 0; virtual void setSignalProxy(SignalProxy *proxy) = 0; - const QDateTime &connectedSince() const; + QDateTime connectedSince() const; void setConnectedSince(const QDateTime &connectedSince); - const QString &buildDate() const; + QString buildDate() const; void setBuildDate(const QString &buildDate); - const QString &clientVersion() const; + QString clientVersion() const; void setClientVersion(const QString &clientVersion); + Quassel::Features features() const; + void setFeatures(Quassel::Features features); + int id() const; void setId(int id); @@ -102,6 +105,7 @@ private: QString _buildDate; QString _clientVersion; + Quassel::Features _features; int _id = -1; }; @@ -119,7 +123,7 @@ template inline void Peer::handle(const T &protoMessage) { switch(protoMessage.handler()) { - case Protocol::SignalProxy: + case Protocol::Handler::SignalProxy: if (!signalProxy()) { qWarning() << Q_FUNC_INFO << "Cannot handle message without a SignalProxy!"; return; @@ -127,7 +131,7 @@ void Peer::handle(const T &protoMessage) signalProxy()->handle(this, protoMessage); break; - case Protocol::AuthHandler: + case Protocol::Handler::AuthHandler: if (!authHandler()) { qWarning() << Q_FUNC_INFO << "Cannot handle auth messages without an active AuthHandler!"; return; @@ -140,5 +144,3 @@ void Peer::handle(const T &protoMessage) return; } } - -#endif