summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/MUC')
-rw-r--r--Swiften/MUC/MUC.cpp12
-rw-r--r--Swiften/MUC/MUC.h2
2 files changed, 14 insertions, 0 deletions
diff --git a/Swiften/MUC/MUC.cpp b/Swiften/MUC/MUC.cpp
index 6fe8f19..4c9e537 100644
--- a/Swiften/MUC/MUC.cpp
+++ b/Swiften/MUC/MUC.cpp
@@ -21,6 +21,7 @@
#include <Swiften/Elements/MUCAdminPayload.h>
#include <Swiften/Elements/MUCPayload.h>
#include <Swiften/Elements/MUCDestroyPayload.h>
+#include <Swiften/Elements/MUCInvitationPayload.h>
#include <Swiften/MUC/MUCRegistry.h>
#include <Swiften/Queries/GenericRequest.h>
@@ -286,6 +287,17 @@ void MUC::destroyRoom() {
request->send();
}
+void MUC::invitePerson(const JID& person, const std::string& reason) {
+ Message::ref message = boost::make_shared<Message>();
+ message->setTo(person);
+ message->setType(Message::Normal);
+ MUCInvitationPayload::ref invite = boost::make_shared<MUCInvitationPayload>();
+ invite->setReason(reason);
+ invite->setJID(ownMUCJID.toBare());
+ message->addPayload(invite);
+ stanzaChannel->sendMessage(message);
+}
+
//TODO: Invites(direct/mediated)
//TODO: requesting membership
diff --git a/Swiften/MUC/MUC.h b/Swiften/MUC/MUC.h
index b99c4b4..45b8004 100644
--- a/Swiften/MUC/MUC.h
+++ b/Swiften/MUC/MUC.h
@@ -61,6 +61,8 @@ namespace Swift {
void requestConfigurationForm();
void configureRoom(Form::ref);
void destroyRoom();
+ /** Send an invite for the person to join the MUC */
+ void invitePerson(const JID& person, const std::string& reason = "");
public:
boost::signal<void (const std::string& /*nick*/)> onJoinComplete;
boost::signal<void (ErrorPayload::ref)> onJoinFailed;