summaryrefslogtreecommitdiff
path: root/src/xmpp/xmpp_component.cpp
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2017-03-30 18:16:44 +0200
committerlouiz’ <louiz@louiz.org>2017-03-30 18:16:44 +0200
commit7f2127a7ea4c49fc1fbcd6cd6fb13e0265f4d841 (patch)
tree0b26c2742f00ac424bd19909695b24e6fd452d52 /src/xmpp/xmpp_component.cpp
parent1090f3ceda3a4e87e592fa5aab33ce3e8fb05918 (diff)
downloadbiboumi-7f2127a7ea4c49fc1fbcd6cd6fb13e0265f4d841.tar.gz
biboumi-7f2127a7ea4c49fc1fbcd6cd6fb13e0265f4d841.tar.bz2
biboumi-7f2127a7ea4c49fc1fbcd6cd6fb13e0265f4d841.tar.xz
biboumi-7f2127a7ea4c49fc1fbcd6cd6fb13e0265f4d841.zip
Add the archive ID to messages when they are sent to users
This makes us compatible with mam 6.0 fix #3249
Diffstat (limited to 'src/xmpp/xmpp_component.cpp')
-rw-r--r--src/xmpp/xmpp_component.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/xmpp/xmpp_component.cpp b/src/xmpp/xmpp_component.cpp
index 6829cef..8335c8a 100644
--- a/src/xmpp/xmpp_component.cpp
+++ b/src/xmpp/xmpp_component.cpp
@@ -380,7 +380,7 @@ void XmppComponent::send_topic(const std::string& from, Xmpp::body&& topic, cons
this->send_stanza(message);
}
-void XmppComponent::send_muc_message(const std::string& muc_name, const std::string& nick, Xmpp::body&& xmpp_body, const std::string& jid_to)
+void XmppComponent::send_muc_message(const std::string& muc_name, const std::string& nick, Xmpp::body&& xmpp_body, const std::string& jid_to, std::string uuid)
{
Stanza message("message");
message["to"] = jid_to;
@@ -402,6 +402,15 @@ void XmppComponent::send_muc_message(const std::string& muc_name, const std::str
// Pass the ownership of the pointer to this xmlnode
html.add_child(std::move(std::get<1>(xmpp_body)));
}
+
+ if (!uuid.empty())
+ {
+ XmlSubNode stanza_id(message, "stanza-id");
+ stanza_id["xmlns"] = STABLE_ID_NS;
+ stanza_id["by"] = muc_name + "@" + this->served_hostname;
+ stanza_id["id"] = std::move(uuid);
+ }
+
this->send_stanza(message);
}