From b2e7edeea8bf08b6b7e75d60af3af0c30fdaa4f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Fri, 24 Jun 2016 11:23:01 +0200 Subject: =?UTF-8?q?Properly=20set=20the=20=E2=80=9Cfrom=E2=80=9D=20of=20th?= =?UTF-8?q?e=20ping=20results=20to=20the=20correct=20full=20JID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- louloulibs/xmpp/xmpp_component.cpp | 10 ++++++++++ louloulibs/xmpp/xmpp_component.hpp | 2 ++ src/bridge/bridge.cpp | 3 +-- src/xmpp/biboumi_component.cpp | 4 ++-- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/louloulibs/xmpp/xmpp_component.cpp b/louloulibs/xmpp/xmpp_component.cpp index 1be7a06..e87cdf7 100644 --- a/louloulibs/xmpp/xmpp_component.cpp +++ b/louloulibs/xmpp/xmpp_component.cpp @@ -631,6 +631,16 @@ void XmppComponent::send_iq_version_request(const std::string& from, this->send_stanza(iq); } +void XmppComponent::send_iq_result_full_jid(const std::string& id, const std::string& to_jid, const std::string& from_full_jid) +{ + Stanza iq("iq"); + iq["from"] = from_full_jid; + iq["to"] = to_jid; + iq["id"] = id; + iq["type"] = "result"; + this->send_stanza(iq); +} + void XmppComponent::send_iq_result(const std::string& id, const std::string& to_jid, const std::string& from_local_part) { Stanza iq("iq"); diff --git a/louloulibs/xmpp/xmpp_component.hpp b/louloulibs/xmpp/xmpp_component.hpp index 913e337..ae4d76b 100644 --- a/louloulibs/xmpp/xmpp_component.hpp +++ b/louloulibs/xmpp/xmpp_component.hpp @@ -200,6 +200,8 @@ public: * Send an empty iq of type result */ void send_iq_result(const std::string& id, const std::string& to_jid, const std::string& from); + void send_iq_result_full_jid(const std::string& id, const std::string& to_jid, + const std::string& from_full_jid); void handle_handshake(const Stanza& stanza); void handle_error(const Stanza& stanza); diff --git a/src/bridge/bridge.cpp b/src/bridge/bridge.cpp index 4976ed2..eee4bd2 100644 --- a/src/bridge/bridge.cpp +++ b/src/bridge/bridge.cpp @@ -483,8 +483,7 @@ void Bridge::send_irc_user_ping_request(const std::string& irc_hostname, const s const std::string id = body.substr(6, body.size() - 7); if (id != iq_id) return false; - Jid jid(from_jid); - this->xmpp.send_iq_result(iq_id, to_jid, jid.local); + this->xmpp.send_iq_result_full_jid(iq_id, to_jid, from_jid); return true; } if (message.command == "401" && message.arguments[1] == nick) diff --git a/src/xmpp/biboumi_component.cpp b/src/xmpp/biboumi_component.cpp index 62e17d0..e4d4899 100644 --- a/src/xmpp/biboumi_component.cpp +++ b/src/xmpp/biboumi_component.cpp @@ -580,8 +580,8 @@ void BiboumiComponent::send_iq_version_request(const std::string& from, } void BiboumiComponent::send_ping_request(const std::string& from, - const std::string& jid_to, - const std::string& id) + const std::string& jid_to, + const std::string& id) { Stanza iq("iq"); iq["type"] = "get"; -- cgit v1.2.3