summaryrefslogtreecommitdiff
path: root/src/xmpp
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2014-04-15 04:45:59 +0200
committerFlorent Le Coz <louiz@louiz.org>2014-04-15 04:45:59 +0200
commit0d9c1ba31336f137202471841fd4fc7ca78a5c11 (patch)
treed8c359b9e1e3a4f81d50ca8c9a03e421fb768860 /src/xmpp
parentcfca16bbecac9f14812db6d06588aae60cc55649 (diff)
parent804b686f1ce4e52174cfbaa1d3f5496c74a9d651 (diff)
downloadbiboumi-0d9c1ba31336f137202471841fd4fc7ca78a5c11.tar.gz
biboumi-0d9c1ba31336f137202471841fd4fc7ca78a5c11.tar.bz2
biboumi-0d9c1ba31336f137202471841fd4fc7ca78a5c11.tar.xz
biboumi-0d9c1ba31336f137202471841fd4fc7ca78a5c11.zip
Merge branch 'master' into dummy_chan
Diffstat (limited to 'src/xmpp')
-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 8e8cc91..a5e9842 100644
--- a/src/xmpp/xmpp_component.cpp
+++ b/src/xmpp/xmpp_component.cpp
@@ -577,13 +577,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));
}