X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcommon%2Fpeer.h;h=c77c6bfa297505d90441f1181f5ca7a675e34115;hb=74226102118400b228618f7373137a4a01e7d85f;hp=64a333ce671852d9e6d91c7b2c3c713da0096e94;hpb=323034d98bb5e2cee84234e3095435825d2bd1ad;p=quassel.git diff --git a/src/common/peer.h b/src/common/peer.h index 64a333ce..c77c6bfa 100644 --- a/src/common/peer.h +++ b/src/common/peer.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2016 by the Quassel Project * + * Copyright (C) 2005-2018 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -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 @@ -51,6 +51,10 @@ public: QString clientVersion() const; void setClientVersion(const QString &clientVersion); + bool hasFeature(Quassel::Feature feature) const; + Quassel::Features features() const; + void setFeatures(Quassel::Features features); + int id() const; void setId(int id); @@ -102,6 +106,7 @@ private: QString _buildDate; QString _clientVersion; + Quassel::Features _features; int _id = -1; }; @@ -119,7 +124,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 +132,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 +145,3 @@ void Peer::handle(const T &protoMessage) return; } } - -#endif