summaryrefslogtreecommitdiff
path: root/louloulibs
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2016-12-13 22:47:19 +0100
committerlouiz’ <louiz@louiz.org>2016-12-13 22:47:19 +0100
commit2e4a9fe4c78bb45de912d2e5b90106397d59348e (patch)
tree94ebb2a12a04d8476b94e58638a37308dbe4eb5d /louloulibs
parent35e1155232ecc3e1cb526d07db3420b11f4717dd (diff)
downloadbiboumi-2e4a9fe4c78bb45de912d2e5b90106397d59348e.tar.gz
biboumi-2e4a9fe4c78bb45de912d2e5b90106397d59348e.tar.bz2
biboumi-2e4a9fe4c78bb45de912d2e5b90106397d59348e.tar.xz
biboumi-2e4a9fe4c78bb45de912d2e5b90106397d59348e.zip
Include the optional <text/> node in the send_presence_error
Diffstat (limited to 'louloulibs')
-rw-r--r--louloulibs/xmpp/xmpp_component.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/louloulibs/xmpp/xmpp_component.cpp b/louloulibs/xmpp/xmpp_component.cpp
index 1d1c58b..c842701 100644
--- a/louloulibs/xmpp/xmpp_component.cpp
+++ b/louloulibs/xmpp/xmpp_component.cpp
@@ -524,7 +524,7 @@ void XmppComponent::send_presence_error(const std::string& muc_name,
const std::string& type,
const std::string& condition,
const std::string& error_code,
- const std::string& /* text */)
+ const std::string& text)
{
Stanza presence("presence");
presence["from"] = muc_name + "@" + this->served_hostname + "/" + nickname;
@@ -536,6 +536,12 @@ void XmppComponent::send_presence_error(const std::string& muc_name,
XmlNode error("error");
error["by"] = muc_name + "@" + this->served_hostname;
error["type"] = type;
+ if (text.empty())
+ {
+ XmlNode text_node("text");
+ text_node["xmlns"] = STANZA_NS;
+ text_node.set_inner(text);
+ }
if (!error_code.empty())
error["code"] = error_code;
XmlNode subnode(condition);