X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcommon%2Fpeer.cpp;h=7d11af3617a42dfa3a085a034b34a19b4817bbea;hb=18389a713a6810f57ab237b945e8ee03df857b8b;hp=14041597310464ccbe619cfa3ca2b58e4ce72c0f;hpb=b65b9f7615165e8700a44d59b7275a55558dd45b;p=quassel.git diff --git a/src/common/peer.cpp b/src/common/peer.cpp index 14041597..7d11af36 100644 --- a/src/common/peer.cpp +++ b/src/common/peer.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2015 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 * @@ -32,3 +32,25 @@ 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; +}