X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fpeer.cpp;h=c076806f3c3d3eca134055de859baf29381716cc;hp=62b5f790197338c5ea819228c79f02eec50e51fe;hb=4259bc3c5b11164245535e011a69efa6937bb6a6;hpb=fd25e92f19d6afd4eb02844bcbf20ba132868303 diff --git a/src/common/peer.cpp b/src/common/peer.cpp index 62b5f790..c076806f 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-2015 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -17,3 +17,40 @@ * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ + +#include "peer.h" + +Peer::Peer(AuthHandler *authHandler, QObject *parent) + : QObject(parent) + , _authHandler(authHandler) +{ + +} + + +AuthHandler *Peer::authHandler() const +{ + return _authHandler; +} + + +// 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; +}