Commit b2e7edee authored by louiz’'s avatar louiz’

Properly set the “from” of the ping results to the correct full JID

parent 4e959a38
...@@ -631,6 +631,16 @@ void XmppComponent::send_iq_version_request(const std::string& from, ...@@ -631,6 +631,16 @@ void XmppComponent::send_iq_version_request(const std::string& from,
this->send_stanza(iq); 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) void XmppComponent::send_iq_result(const std::string& id, const std::string& to_jid, const std::string& from_local_part)
{ {
Stanza iq("iq"); Stanza iq("iq");
......
...@@ -200,6 +200,8 @@ public: ...@@ -200,6 +200,8 @@ public:
* Send an empty iq of type result * 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(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_handshake(const Stanza& stanza);
void handle_error(const Stanza& stanza); void handle_error(const Stanza& stanza);
......
...@@ -483,8 +483,7 @@ void Bridge::send_irc_user_ping_request(const std::string& irc_hostname, const s ...@@ -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); const std::string id = body.substr(6, body.size() - 7);
if (id != iq_id) if (id != iq_id)
return false; return false;
Jid jid(from_jid); this->xmpp.send_iq_result_full_jid(iq_id, to_jid, from_jid);
this->xmpp.send_iq_result(iq_id, to_jid, jid.local);
return true; return true;
} }
if (message.command == "401" && message.arguments[1] == nick) if (message.command == "401" && message.arguments[1] == nick)
......
...@@ -580,8 +580,8 @@ void BiboumiComponent::send_iq_version_request(const std::string& from, ...@@ -580,8 +580,8 @@ void BiboumiComponent::send_iq_version_request(const std::string& from,
} }
void BiboumiComponent::send_ping_request(const std::string& from, void BiboumiComponent::send_ping_request(const std::string& from,
const std::string& jid_to, const std::string& jid_to,
const std::string& id) const std::string& id)
{ {
Stanza iq("iq"); Stanza iq("iq");
iq["type"] = "get"; iq["type"] = "get";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment