summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-11-10 22:02:28 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-11-10 22:33:58 (GMT)
commit2fec654b2345ba974b843a0868d580f9c12fdfea (patch)
treeaee0bf059eaf66864c56e31316921fb428dad114 /Swiften/Queries/Requests
parent896e2a121d58931740ea8becc0544e10e629c6c5 (diff)
downloadswift-contrib-2fec654b2345ba974b843a0868d580f9c12fdfea.zip
swift-contrib-2fec654b2345ba974b843a0868d580f9c12fdfea.tar.bz2
Added InBandRegistration classes.
Diffstat (limited to 'Swiften/Queries/Requests')
-rw-r--r--Swiften/Queries/Requests/GetInBandRegistrationFormRequest.cpp7
-rw-r--r--Swiften/Queries/Requests/GetInBandRegistrationFormRequest.h26
-rw-r--r--Swiften/Queries/Requests/SubmitInBandRegistrationFormRequest.cpp7
-rw-r--r--Swiften/Queries/Requests/SubmitInBandRegistrationFormRequest.h36
4 files changed, 76 insertions, 0 deletions
diff --git a/Swiften/Queries/Requests/GetInBandRegistrationFormRequest.cpp b/Swiften/Queries/Requests/GetInBandRegistrationFormRequest.cpp
new file mode 100644
index 0000000..5f6be03
--- /dev/null
+++ b/Swiften/Queries/Requests/GetInBandRegistrationFormRequest.cpp
@@ -0,0 +1,7 @@
+/*
+ * Copyright (c) 2010 Remko Tronçon
+ * Licensed under the GNU General Public License v3.
+ * See Documentation/Licenses/GPLv3.txt for more information.
+ */
+
+#include "Swiften/Queries/Requests/GetInBandRegistrationFormRequest.h"
diff --git a/Swiften/Queries/Requests/GetInBandRegistrationFormRequest.h b/Swiften/Queries/Requests/GetInBandRegistrationFormRequest.h
new file mode 100644
index 0000000..33bc156
--- /dev/null
+++ b/Swiften/Queries/Requests/GetInBandRegistrationFormRequest.h
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2010 Remko Tronçon
+ * Licensed under the GNU General Public License v3.
+ * See Documentation/Licenses/GPLv3.txt for more information.
+ */
+
+#pragma once
+
+#include "Swiften/Queries/GenericRequest.h"
+#include "Swiften/Elements/InBandRegistrationPayload.h"
+
+
+namespace Swift {
+ class GetInBandRegistrationFormRequest : public GenericRequest<InBandRegistrationPayload> {
+ public:
+ typedef boost::shared_ptr<GetInBandRegistrationFormRequest> ref;
+
+ static ref create(IQRouter* router) {
+ return ref(new GetInBandRegistrationFormRequest(router));
+ }
+
+ private:
+ GetInBandRegistrationFormRequest(IQRouter* router) : GenericRequest<InBandRegistrationPayload>(IQ::Get, JID(), InBandRegistrationPayload::ref(new InBandRegistrationPayload()), router) {
+ }
+ };
+}
diff --git a/Swiften/Queries/Requests/SubmitInBandRegistrationFormRequest.cpp b/Swiften/Queries/Requests/SubmitInBandRegistrationFormRequest.cpp
new file mode 100644
index 0000000..f28c878
--- /dev/null
+++ b/Swiften/Queries/Requests/SubmitInBandRegistrationFormRequest.cpp
@@ -0,0 +1,7 @@
+/*
+ * Copyright (c) 2010 Remko Tronçon
+ * Licensed under the GNU General Public License v3.
+ * See Documentation/Licenses/GPLv3.txt for more information.
+ */
+
+#include "Swiften/Queries/Requests/SubmitInBandRegistrationFormRequest.h"
diff --git a/Swiften/Queries/Requests/SubmitInBandRegistrationFormRequest.h b/Swiften/Queries/Requests/SubmitInBandRegistrationFormRequest.h
new file mode 100644
index 0000000..3ed14bb
--- /dev/null
+++ b/Swiften/Queries/Requests/SubmitInBandRegistrationFormRequest.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2010 Kevin Smith
+ * Licensed under the GNU General Public License v3.
+ * See Documentation/Licenses/GPLv3.txt for more information.
+ */
+
+#pragma once
+
+#include "Swiften/Base/boost_bsignals.h"
+#include <boost/shared_ptr.hpp>
+
+#include "Swiften/Queries/Request.h"
+#include "Swiften/Elements/InBandRegistrationPayload.h"
+
+
+namespace Swift {
+ class SetInBandRegistrationRequest : public Request {
+ public:
+ typedef boost::shared_ptr<SetInBandRegistrationRequest> ref;
+
+ static ref create(InBandRegistrationPayload::ref payload, IQRouter* router) {
+ return ref(new SetInBandRegistrationRequest(payload, router));
+ }
+
+ private:
+ SetInBandRegistrationRequest(InBandRegistrationPayload::ref payload, IQRouter* router) : Request(IQ::Set, JID(), InBandRegistrationPayload::ref(payload), router) {
+ }
+
+ virtual void handleResponse(Payload::ref payload, boost::optional<ErrorPayload> error) {
+ onResponse(payload, error);
+ }
+
+ public:
+ boost::signal<void (Payload::ref, const boost::optional<ErrorPayload>&)> onResponse;
+ };
+}