summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2011-09-28 16:45:00 (GMT)
committerKevin Smith <git@kismith.co.uk>2011-09-28 16:45:00 (GMT)
commit1daf22de85758cfd035f1fcf6a70007315db4f28 (patch)
treeae822e3db619af06ec1b26fd342165b24fe89543 /Swiften/MUC
parent5c544f02222a3318b8581f68071b6a6b66b1d4c0 (diff)
downloadswift-contrib-1daf22de85758cfd035f1fcf6a70007315db4f28.zip
swift-contrib-1daf22de85758cfd035f1fcf6a70007315db4f28.tar.bz2
Destroy rooms.
Resolves: #990
Diffstat (limited to 'Swiften/MUC')
-rw-r--r--Swiften/MUC/MUC.cpp10
-rw-r--r--Swiften/MUC/MUC.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/Swiften/MUC/MUC.cpp b/Swiften/MUC/MUC.cpp
index c450c6d..6fe8f19 100644
--- a/Swiften/MUC/MUC.cpp
+++ b/Swiften/MUC/MUC.cpp
@@ -20,6 +20,7 @@
#include <Swiften/Elements/MUCUserPayload.h>
#include <Swiften/Elements/MUCAdminPayload.h>
#include <Swiften/Elements/MUCPayload.h>
+#include <Swiften/Elements/MUCDestroyPayload.h>
#include <Swiften/MUC/MUCRegistry.h>
#include <Swiften/Queries/GenericRequest.h>
@@ -276,6 +277,15 @@ void MUC::configureRoom(Form::ref form) {
request->send();
}
+void MUC::destroyRoom() {
+ MUCOwnerPayload::ref mucPayload = boost::make_shared<MUCOwnerPayload>();
+ MUCDestroyPayload::ref mucDestroyPayload = boost::make_shared<MUCDestroyPayload>();
+ mucPayload->setPayload(mucDestroyPayload);
+ GenericRequest<MUCOwnerPayload>* request = new GenericRequest<MUCOwnerPayload>(IQ::Set, getJID(), mucPayload, iqRouter_);
+ request->onResponse.connect(boost::bind(&MUC::handleConfigurationResultReceived, this, _1, _2));
+ request->send();
+}
+
//TODO: Invites(direct/mediated)
//TODO: requesting membership
diff --git a/Swiften/MUC/MUC.h b/Swiften/MUC/MUC.h
index 4017c97..b99c4b4 100644
--- a/Swiften/MUC/MUC.h
+++ b/Swiften/MUC/MUC.h
@@ -60,6 +60,7 @@ namespace Swift {
void changeSubject(const std::string& subject);
void requestConfigurationForm();
void configureRoom(Form::ref);
+ void destroyRoom();
public:
boost::signal<void (const std::string& /*nick*/)> onJoinComplete;
boost::signal<void (ErrorPayload::ref)> onJoinFailed;