summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften')
-rw-r--r--Swiften/Queries/Responders/RosterPushResponder.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/Swiften/Queries/Responders/RosterPushResponder.h b/Swiften/Queries/Responders/RosterPushResponder.h
new file mode 100644
index 0000000..69185c8
--- /dev/null
+++ b/Swiften/Queries/Responders/RosterPushResponder.h
@@ -0,0 +1,23 @@
+#pragma once
+
+#include <boost/signal.hpp>
+
+#include "Swiften/Queries/SetResponder.h"
+#include "Swiften/Elements/RosterPayload.h"
+
+namespace Swift {
+ class RosterPushResponder : public SetResponder<RosterPayload> {
+ public:
+ RosterPushResponder(IQRouter* router) : SetResponder<RosterPayload>(router) {}
+
+ public:
+ boost::signal<void (boost::shared_ptr<RosterPayload>)> onRosterReceived;
+
+ private:
+ virtual bool handleSetRequest(const JID& from, const String& id, boost::shared_ptr<RosterPayload> payload) {
+ onRosterReceived(payload);
+ sendResponse(from, id, boost::shared_ptr<Payload>());
+ return true;
+ }
+ };
+}