summaryrefslogtreecommitdiff
path: root/src/xmpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/xmpp')
-rw-r--r--src/xmpp/biboumi_component.cpp16
-rw-r--r--src/xmpp/biboumi_component.hpp1
2 files changed, 17 insertions, 0 deletions
diff --git a/src/xmpp/biboumi_component.cpp b/src/xmpp/biboumi_component.cpp
index cb9aac8..5c52494 100644
--- a/src/xmpp/biboumi_component.cpp
+++ b/src/xmpp/biboumi_component.cpp
@@ -645,3 +645,19 @@ void BiboumiComponent::send_iq_room_list_result(const std::string& id,
iq.add_child(std::move(query));
this->send_stanza(iq);
}
+
+void BiboumiComponent::send_invitation(const std::string& room_target,
+ const std::string& jid_to,
+ const std::string& author_nick)
+{
+ Stanza message("message");
+ message["from"] = room_target + "@" + this->served_hostname;
+ message["to"] = jid_to;
+ XmlNode x("x");
+ x["xmlns"] = MUC_USER_NS;
+ XmlNode invite("invite");
+ invite["from"] = room_target + "@" + this->served_hostname + "/" + author_nick;
+ x.add_child(std::move(invite));
+ message.add_child(std::move(x));
+ this->send_stanza(message);
+}
diff --git a/src/xmpp/biboumi_component.hpp b/src/xmpp/biboumi_component.hpp
index 24d768a..0dbf8f1 100644
--- a/src/xmpp/biboumi_component.hpp
+++ b/src/xmpp/biboumi_component.hpp
@@ -74,6 +74,7 @@ public:
void send_iq_room_list_result(const std::string& id, const std::string& to_jid,
const std::string& from,
const std::vector<ListElement>& rooms_list);
+ void send_invitation(const std::string& room_target, const std::string& jid_to, const std::string& author_nick);
/**
* Handle the various stanza types
*/