diff options
-rw-r--r-- | src/xmpp/xmpp_component.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/xmpp/xmpp_component.cpp b/src/xmpp/xmpp_component.cpp index 606be10..a27df32 100644 --- a/src/xmpp/xmpp_component.cpp +++ b/src/xmpp/xmpp_component.cpp @@ -576,13 +576,21 @@ void XmppComponent::send_muc_leave(std::string&& muc_name, std::string&& nick, X presence["from"] = muc_name + "@" + this->served_hostname + "/" + nick; presence["type"] = "unavailable"; const std::string message_str = std::get<0>(message); - if (!message_str.empty() || self) + XmlNode x("x"); + x["xmlns"] = MUC_USER_NS; + if (self) + { + XmlNode status("status"); + status["code"] = "110"; + status.close(); + x.add_child(std::move(status)); + } + x.close(); + presence.add_child(std::move(x)); + if (!message_str.empty()) { XmlNode status("status"); - if (!message_str.empty()) - status.set_inner(message_str); - if (self) - status["code"] = "110"; + status.set_inner(message_str); status.close(); presence.add_child(std::move(status)); } |