summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2016-05-18 22:53:17 +0200
committerlouiz’ <louiz@louiz.org>2016-06-08 01:42:43 +0200
commit367de4826c3c7298a88e80c92e325081a3c3d794 (patch)
tree260ab1b2b70837270a22554e2f2bd09abc866f69 /src
parent0a2123f8a2db3f94aa5758868e999cb3224235c2 (diff)
downloadbiboumi-367de4826c3c7298a88e80c92e325081a3c3d794.tar.gz
biboumi-367de4826c3c7298a88e80c92e325081a3c3d794.tar.bz2
biboumi-367de4826c3c7298a88e80c92e325081a3c3d794.tar.xz
biboumi-367de4826c3c7298a88e80c92e325081a3c3d794.zip
Associate a bridge with a bare JID instead of a full JID
ref #2556
Diffstat (limited to 'src')
-rw-r--r--src/xmpp/biboumi_component.cpp10
-rw-r--r--src/xmpp/biboumi_component.hpp2
2 files changed, 7 insertions, 5 deletions
diff --git a/src/xmpp/biboumi_component.cpp b/src/xmpp/biboumi_component.cpp
index 5b1d0e0..94d85c6 100644
--- a/src/xmpp/biboumi_component.cpp
+++ b/src/xmpp/biboumi_component.cpp
@@ -507,22 +507,24 @@ void BiboumiComponent::handle_iq(const Stanza& stanza)
Bridge* BiboumiComponent::get_user_bridge(const std::string& user_jid)
{
+ auto bare_jid = Jid{user_jid}.bare();
try
{
- return this->bridges.at(user_jid).get();
+ return this->bridges.at(bare_jid).get();
}
catch (const std::out_of_range& exception)
{
- this->bridges.emplace(user_jid, std::make_unique<Bridge>(user_jid, *this, this->poller));
- return this->bridges.at(user_jid).get();
+ this->bridges.emplace(bare_jid, std::make_unique<Bridge>(bare_jid, *this, this->poller));
+ return this->bridges.at(bare_jid).get();
}
}
Bridge* BiboumiComponent::find_user_bridge(const std::string& user_jid)
{
+ auto bare_jid = Jid{user_jid}.bare();
try
{
- return this->bridges.at(user_jid).get();
+ return this->bridges.at(bare_jid).get();
}
catch (const std::out_of_range& exception)
{
diff --git a/src/xmpp/biboumi_component.hpp b/src/xmpp/biboumi_component.hpp
index f1817e2..4d5995e 100644
--- a/src/xmpp/biboumi_component.hpp
+++ b/src/xmpp/biboumi_component.hpp
@@ -83,7 +83,7 @@ public:
private:
/**
- * Return the bridge associated with the given full JID. Create a new one
+ * Return the bridge associated with the bare JID. Create a new one
* if none already exist.
*/
Bridge* get_user_bridge(const std::string& user_jid);