summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2014-04-15 04:45:20 +0200
committerFlorent Le Coz <louiz@louiz.org>2014-04-15 04:45:20 +0200
commit804b686f1ce4e52174cfbaa1d3f5496c74a9d651 (patch)
tree9fe1c6750254c258a36d2a7c43b0d29c3c06be07 /src
parentc64bb0bde9dbf572bd4d3bbaf478ec812a2f12d6 (diff)
downloadbiboumi-804b686f1ce4e52174cfbaa1d3f5496c74a9d651.tar.gz
biboumi-804b686f1ce4e52174cfbaa1d3f5496c74a9d651.tar.bz2
biboumi-804b686f1ce4e52174cfbaa1d3f5496c74a9d651.tar.xz
biboumi-804b686f1ce4e52174cfbaa1d3f5496c74a9d651.zip
Fix the leave-muc presence stanza
Diffstat (limited to 'src')
-rw-r--r--src/xmpp/xmpp_component.cpp18
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));
}