X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fpeer.h;h=32ee0b5f5eb1edcfa7842e344c3374401b8be070;hp=aa8d0fe8b5491d6895297b7bebb88c96076d55bf;hb=9ef86f499753853c3751aee7da54d186837a5161;hpb=64cf9f9b8a737dad5f29447805d4004cfd03c454 diff --git a/src/common/peer.h b/src/common/peer.h index aa8d0fe8..32ee0b5f 100644 --- a/src/common/peer.h +++ b/src/common/peer.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2013 by the Quassel Project * + * Copyright (C) 2005-2016 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -22,6 +22,7 @@ #define PEER_H #include +#include #include #include "authhandler.h" @@ -35,6 +36,7 @@ class Peer : public QObject public: Peer(AuthHandler *authHandler, QObject *parent = 0); + virtual Protocol::Type protocol() const = 0; virtual QString description() const = 0; virtual SignalProxy *signalProxy() const = 0; @@ -48,6 +50,15 @@ public: virtual int lag() const = 0; + virtual QString address() const = 0; + virtual quint16 port() const = 0; + + int _id = -1; + + QDateTime _connectedSince; + QString _buildDate; + QString _clientVersion; + public slots: /* Handshake messages */ virtual void dispatch(const Protocol::RegisterClient &) = 0; @@ -82,6 +93,13 @@ private: QPointer _authHandler; }; +// We need to special-case Peer* in attached signals/slots, so typedef it for the meta type system +typedef Peer * PeerPtr; +Q_DECLARE_METATYPE(PeerPtr) + +QDataStream &operator<<(QDataStream &out, PeerPtr ptr); +QDataStream &operator>>(QDataStream &in, PeerPtr &ptr); + // Template method needed in the header template inline