X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fpeer.cpp;h=b0eee4442c26e99bd8adc3a7ca894324c27f9309;hp=671f634f1cde119ecbfde5dc3fff03354e8c96d2;hb=323034d98bb5e2cee84234e3095435825d2bd1ad;hpb=64cf9f9b8a737dad5f29447805d4004cfd03c454 diff --git a/src/common/peer.cpp b/src/common/peer.cpp index 671f634f..b0eee444 100644 --- a/src/common/peer.cpp +++ b/src/common/peer.cpp @@ -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 * @@ -32,3 +32,56 @@ AuthHandler *Peer::authHandler() const { return _authHandler; } + +QDateTime Peer::connectedSince() const { + return _connectedSince; +} + +void Peer::setConnectedSince(const QDateTime &connectedSince) { + _connectedSince = connectedSince; +} + +QString Peer::buildDate() const { + return _buildDate; +} + +void Peer::setBuildDate(const QString &buildDate) { + _buildDate = buildDate; +} + +QString Peer::clientVersion() const { + return _clientVersion; +} + +void Peer::setClientVersion(const QString &clientVersion) { + _clientVersion = clientVersion; +} + +int Peer::id() const { + return _id; +} + +void Peer::setId(int id) { + _id = id; +} + +// PeerPtr is used in RPC signatures for enabling receivers to send replies +// to a particular peer rather than broadcast to all connected ones. +// To enable this, the SignalProxy transparently replaces the bogus value +// received over the network with the actual address of the local Peer +// instance. Because the actual value isn't needed on the wire, it is +// serialized as null. +QDataStream &operator<<(QDataStream &out, PeerPtr ptr) +{ + Q_UNUSED(ptr); + out << static_cast(0); // 64 bit for historic reasons + return out; +} + +QDataStream &operator>>(QDataStream &in, PeerPtr &ptr) +{ + ptr = nullptr; + quint64 value; + in >> value; + return in; +}