diff options
author | louiz’ <louiz@louiz.org> | 2016-10-11 00:43:46 +0200 |
---|---|---|
committer | louiz’ <louiz@louiz.org> | 2016-10-11 00:43:46 +0200 |
commit | dfc0793ef2fec12d2613b53b27f1a7f85dae2688 (patch) | |
tree | e1e2d8fbb3464cc5a90ff0d846dabc038c81391e /louloulibs/xmpp/xmpp_component.cpp | |
parent | 548e4ad473e7be22f971184312cc5ce9b8fe56b7 (diff) | |
download | biboumi-dfc0793ef2fec12d2613b53b27f1a7f85dae2688.tar.gz biboumi-dfc0793ef2fec12d2613b53b27f1a7f85dae2688.tar.bz2 biboumi-dfc0793ef2fec12d2613b53b27f1a7f85dae2688.tar.xz biboumi-dfc0793ef2fec12d2613b53b27f1a7f85dae2688.zip |
Include a private and no-copy nodes in private <message/> to avoid carbon duplication
Diffstat (limited to 'louloulibs/xmpp/xmpp_component.cpp')
-rw-r--r-- | louloulibs/xmpp/xmpp_component.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/louloulibs/xmpp/xmpp_component.cpp b/louloulibs/xmpp/xmpp_component.cpp index 1cf3e85..6690567 100644 --- a/louloulibs/xmpp/xmpp_component.cpp +++ b/louloulibs/xmpp/xmpp_component.cpp @@ -273,7 +273,8 @@ void* XmppComponent::get_receive_buffer(const size_t size) const return this->parser.get_buffer(size); } -void XmppComponent::send_message(const std::string& from, Xmpp::body&& body, const std::string& to, const std::string& type, const bool fulljid) +void XmppComponent::send_message(const std::string& from, Xmpp::body&& body, const std::string& to, + const std::string& type, const bool fulljid, const bool nocopy) { XmlNode node("message"); node["to"] = to; @@ -294,6 +295,18 @@ void XmppComponent::send_message(const std::string& from, Xmpp::body&& body, con html.add_child(std::move(std::get<1>(body))); node.add_child(std::move(html)); } + + if (nocopy) + { + XmlNode private_node("private"); + private_node["xmlns"] = "urn:xmpp:carbons:2"; + node.add_child(std::move(private_node)); + + XmlNode nocopy("no-copy"); + nocopy["xmlns"] = "urn:xmpp:hints"; + node.add_child(std::move(nocopy)); + } + this->send_stanza(node); } |