X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcommon%2Fpeer.h;h=803f15b52c2b814ebb2507d49bf1d0d1f5db0d76;hb=80950b87640acfb2a75902f8aabf3419da094bf4;hp=6f17ed665ebdc67f24331b894de90477e5e494d1;hpb=30fa961d1aca319b52071ad9d6e4527ea2638fb7;p=quassel.git diff --git a/src/common/peer.h b/src/common/peer.h index 6f17ed66..803f15b5 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,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef PEER_H -#define PEER_H +#pragma once + +#include "common-export.h" #include #include @@ -27,14 +28,15 @@ #include "authhandler.h" #include "protocol.h" +#include "quassel.h" #include "signalproxy.h" -class Peer : public QObject +class COMMON_EXPORT Peer : public QObject { Q_OBJECT public: - explicit Peer(AuthHandler *authHandler, QObject *parent = 0); + explicit Peer(AuthHandler *authHandler, QObject *parent = nullptr); virtual Protocol::Type protocol() const = 0; virtual QString description() const = 0; @@ -51,6 +53,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,12 +108,13 @@ private: QString _buildDate; QString _clientVersion; + Quassel::Features _features; int _id = -1; }; // We need to special-case Peer* in attached signals/slots, so typedef it for the meta type system -typedef Peer * PeerPtr; +using PeerPtr = Peer *; Q_DECLARE_METATYPE(PeerPtr) QDataStream &operator<<(QDataStream &out, PeerPtr ptr); @@ -140,5 +147,3 @@ void Peer::handle(const T &protoMessage) return; } } - -#endif