Add a <x muc#user> node on outgoing private MUC messages
See https://xmpp.org/extensions/xep-0045.html#privatemessage fix #3321
This commit is contained in:
@@ -269,7 +269,8 @@ void* XmppComponent::get_receive_buffer(const size_t size) const
|
||||
}
|
||||
|
||||
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)
|
||||
const std::string& type, const bool fulljid, const bool nocopy,
|
||||
const bool muc_private)
|
||||
{
|
||||
Stanza message("message");
|
||||
{
|
||||
@@ -301,6 +302,11 @@ void XmppComponent::send_message(const std::string& from, Xmpp::body&& body, con
|
||||
XmlSubNode nocopy(message, "no-copy");
|
||||
nocopy["xmlns"] = "urn:xmpp:hints";
|
||||
}
|
||||
if (muc_private)
|
||||
{
|
||||
XmlSubNode x(message, "x");
|
||||
x["xmlns"] = MUC_USER_NS;
|
||||
}
|
||||
}
|
||||
this->send_stanza(message);
|
||||
}
|
||||
|
||||
@@ -112,7 +112,8 @@ public:
|
||||
* 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, const bool nocopy=false);
|
||||
const std::string& type, const bool fulljid, const bool nocopy=false,
|
||||
const bool muc_private=false);
|
||||
/**
|
||||
* Send a join from a new participant
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user