summaryrefslogtreecommitdiff
path: root/louloulibs
diff options
context:
space:
mode:
Diffstat (limited to 'louloulibs')
-rw-r--r--louloulibs/xmpp/xmpp_component.cpp15
-rw-r--r--louloulibs/xmpp/xmpp_component.hpp5
2 files changed, 16 insertions, 4 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);
}
diff --git a/louloulibs/xmpp/xmpp_component.hpp b/louloulibs/xmpp/xmpp_component.hpp
index 232d47a..45a4038 100644
--- a/louloulibs/xmpp/xmpp_component.hpp
+++ b/louloulibs/xmpp/xmpp_component.hpp
@@ -109,9 +109,8 @@ public:
* If fulljid is false, the provided 'from' doesn't contain the
* server-part of the JID and must be added.
*/
- void send_message(const std::string& from, Xmpp::body&& body,
- const std::string& to, const std::string& type,
- const bool fulljid=false);
+ void send_message(const std::string& from, Xmpp::body&& body, const std::string& to,
+ const std::string& type, const bool fulljid, const bool nocopy=false);
/**
* Send a join from a new participant
*/