Add a <item/> node in the presence of a leaving participant

fix #3339
This commit is contained in:
louiz’
2018-03-12 00:13:59 +01:00
parent 158d743bf5
commit bb596582bd
8 changed files with 40 additions and 22 deletions
+5 -1
View File
@@ -425,7 +425,8 @@ void XmppComponent::send_history_message(const std::string& muc_name, const std:
#endif
void XmppComponent::send_muc_leave(const std::string& muc_name, const std::string& nick, Xmpp::body&& message,
const std::string& jid_to, const bool self, const bool user_requested)
const std::string& jid_to, const bool self, const bool user_requested,
const std::string& affiliation, const std::string& role)
{
Stanza presence("presence");
{
@@ -447,6 +448,9 @@ void XmppComponent::send_muc_leave(const std::string& muc_name, const std::strin
status["code"] = "332";
}
}
XmlSubNode item(x, "item");
item["affiliation"] = affiliation;
item["role"] = role;
if (!message_str.empty())
{
XmlSubNode status(presence, "status");