summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2014-05-31 17:24:18 +0200
committerFlorent Le Coz <louiz@louiz.org>2014-05-31 17:24:18 +0200
commitc530fb9156e3c8248e4a47316f5ac72e221d5811 (patch)
tree611a1212d3535ad76947038b0c2dbb17a849cb71
parent4a9beff74d5ede4acb82c8f7deb3555a4f7bd724 (diff)
downloadbiboumi-c530fb9156e3c8248e4a47316f5ac72e221d5811.tar.gz
biboumi-c530fb9156e3c8248e4a47316f5ac72e221d5811.tar.bz2
biboumi-c530fb9156e3c8248e4a47316f5ac72e221d5811.tar.xz
biboumi-c530fb9156e3c8248e4a47316f5ac72e221d5811.zip
Do not send an item-not-found presence from an invalid JID
-rw-r--r--src/xmpp/xmpp_component.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/xmpp/xmpp_component.cpp b/src/xmpp/xmpp_component.cpp
index 81a3b4f..3ec043c 100644
--- a/src/xmpp/xmpp_component.cpp
+++ b/src/xmpp/xmpp_component.cpp
@@ -640,7 +640,10 @@ void XmppComponent::send_invalid_room_error(const std::string& muc_name,
const std::string& to)
{
Stanza presence("presence");
- presence["from"] = muc_name + "@" + this->served_hostname + "/" + nick;
+ if (!muc_name.empty())
+ presence["from"] = muc_name + "@" + this->served_hostname + "/" + nick;
+ else
+ presence["from"] = this->served_hostname;
presence["to"] = to;
presence["type"] = "error";
XmlNode x("x");