summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2016-06-24 11:23:51 +0200
committerlouiz’ <louiz@louiz.org>2016-06-24 11:23:51 +0200
commit7d2a2dc8cc9d2d9bcd83fb1bd869c29322855fa8 (patch)
tree8c07959a42c0b59d2b8d9a71edc82e7335b9d09b /src
parentb2e7edeea8bf08b6b7e75d60af3af0c30fdaa4f3 (diff)
downloadbiboumi-7d2a2dc8cc9d2d9bcd83fb1bd869c29322855fa8.tar.gz
biboumi-7d2a2dc8cc9d2d9bcd83fb1bd869c29322855fa8.tar.bz2
biboumi-7d2a2dc8cc9d2d9bcd83fb1bd869c29322855fa8.tar.xz
biboumi-7d2a2dc8cc9d2d9bcd83fb1bd869c29322855fa8.zip
Forward ping requests from IRC to XMPP, to one single resource
Diffstat (limited to 'src')
-rw-r--r--src/bridge/bridge.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/bridge/bridge.cpp b/src/bridge/bridge.cpp
index eee4bd2..6de2516 100644
--- a/src/bridge/bridge.cpp
+++ b/src/bridge/bridge.cpp
@@ -746,7 +746,10 @@ void Bridge::send_xmpp_ping_request(const std::string& nick, const std::string&
// Use revstr because the forwarded ping to target XMPP user must not be
// the same that the request iq, but we also need to get it back easily
// (revstr again)
- this->xmpp.send_ping_request(nick + "!" + utils::empty_if_fixed_server(hostname), this->user_jid, utils::revstr(id));
+ // Forward to the first resource (arbitrary, based on the “order” of the std::set) only
+ const auto resources = this->resources_in_server[hostname];
+ if (resources.begin() != resources.end())
+ this->xmpp.send_ping_request(nick + "!" + utils::empty_if_fixed_server(hostname), this->user_jid + "/" + *resources.begin(), utils::revstr(id));
}
void Bridge::set_preferred_from_jid(const std::string& nick, const std::string& full_jid)