diff options
author | louiz’ <louiz@louiz.org> | 2016-08-17 03:42:40 +0200 |
---|---|---|
committer | louiz’ <louiz@louiz.org> | 2016-08-18 20:33:41 +0200 |
commit | 4c8fb9a0e314db88dec1f105144aadafc5796ef2 (patch) | |
tree | 4d374079d1ff718187502c9a68df8fe8607efb54 /src/xmpp | |
parent | 5406de35a39c935a19460da06bf3dcd3948a00d5 (diff) | |
download | biboumi-4c8fb9a0e314db88dec1f105144aadafc5796ef2.tar.gz biboumi-4c8fb9a0e314db88dec1f105144aadafc5796ef2.tar.bz2 biboumi-4c8fb9a0e314db88dec1f105144aadafc5796ef2.tar.xz biboumi-4c8fb9a0e314db88dec1f105144aadafc5796ef2.zip |
Forward IRC invites to XMPP
Diffstat (limited to 'src/xmpp')
-rw-r--r-- | src/xmpp/biboumi_component.cpp | 16 | ||||
-rw-r--r-- | src/xmpp/biboumi_component.hpp | 1 |
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 */ |