Migrate password change RPC to the new target restriction system
[quassel.git] / src / common / signalproxy.h
index b093396..a985d0d 100644 (file)
@@ -78,6 +78,11 @@ public:
     void dumpProxyStats();
     void dumpSyncMap(SyncableObject *object);
 
+    /**
+     * This method allows to send a signal only to a limited set of peers
+     * @param peerIds A list of peers that should receive it
+     * @param closure Code you want to execute within of that restricted environment
+     */
     void restrictTargetPeers(std::initializer_list<Peer *> peerIds, std::function<void()> closure);
 
     inline int peerCount() const { return _peers.size(); }
@@ -85,6 +90,11 @@ public:
 
     Peer *peerById(int peerId);
 
+    /**
+     * @return If handling a signal, the Peer from which the current signal originates
+     */
+    Peer *sourcePeer() { return _sourcePeer; }
+
 public slots:
     void detachObject(QObject *obj);
     void detachSignals(QObject *sender);
@@ -178,6 +188,8 @@ private:
     QSet<Peer *> _restrictedTargets;
     bool _restrictMessageTarget = false;
 
+    Peer *_sourcePeer;
+
     friend class SignalRelay;
     friend class SyncableObject;
     friend class Peer;