From 26ffc8fe121e03e1b663aa0015a71b0fc914f95e Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Thu, 19 Jun 2014 22:21:49 +0200 Subject: Implement a way to add callbacks, waiting for an IRC event to return an iq --- src/xmpp/xmpp_component.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/xmpp/xmpp_component.cpp') diff --git a/src/xmpp/xmpp_component.cpp b/src/xmpp/xmpp_component.cpp index da9cded..901e168 100644 --- a/src/xmpp/xmpp_component.cpp +++ b/src/xmpp/xmpp_component.cpp @@ -220,14 +220,20 @@ void XmppComponent::send_stream_error(const std::string& name, const std::string } void XmppComponent::send_stanza_error(const std::string& kind, const std::string& to, const std::string& from, - const std::string& id, const std::string& error_type, - const std::string& defined_condition, const std::string& text) + const std::string& id, const std::string& error_type, + const std::string& defined_condition, const std::string& text, + const bool fulljid) { Stanza node(kind); if (!to.empty()) node["to"] = to; if (!from.empty()) - node["from"] = from; + { + if (fulljid) + node["from"] = from; + else + node["from"] = from + "@" + this->served_hostname; + } if (!id.empty()) node["id"] = id; node["type"] = "error"; -- cgit v1.2.3