summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2009-06-12 08:40:31 (GMT)
committerRemko Tronçon <git@el-tramo.be>2009-06-12 08:40:31 (GMT)
commit0fa21303c2ea99ff8b89507889de82f768978f23 (patch)
tree9ecc89ef3f6f44b8ba13c0331ceaab468d905dc4 /Swiften/Queries/Responders
parentc12c34c5487c2efdd5b6a91ec7f17d5911c20206 (diff)
downloadswift-contrib-0fa21303c2ea99ff8b89507889de82f768978f23.zip
swift-contrib-0fa21303c2ea99ff8b89507889de82f768978f23.tar.bz2
Do not handle IQs directly in XMPPRosterController.
XMPPRosterController now uses a RosterPushResponder to handle roster pushes.
Diffstat (limited to 'Swiften/Queries/Responders')
-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;
+ }
+ };
+}