From 56de41bb976b804160d0fc038ed545cb0910e0fc 2016-02-10 22:22:05 From: Jan Kaluza Date: 2016-02-10 22:22:05 Subject: [PATCH] Swiften: Check if the legacyname contains the resource and do not append our in that case --- diff --git a/backends/swiften/main.cpp b/backends/swiften/main.cpp index e771f5e05cb797b5fff4dc8ad197c90ce44ae5e4..51e57f27cfe6e457991592ae5229b5b4f0d45999 100644 --- a/backends/swiften/main.cpp +++ b/backends/swiften/main.cpp @@ -301,7 +301,11 @@ class SwiftenPlugin : public NetworkPlugin, Swift::XMPPParserClient { void handleLoginRequest(const std::string &user, const std::string &legacyName, const std::string &password) { LOG4CXX_INFO(logger, user << ": connecting as " << legacyName); - boost::shared_ptr client = boost::make_shared(Swift::JID(legacyName + "/Spectrum"), password, m_factories); + Swift::JID jid(legacyName); + if (legacyName.find("/") == std::string::npos) { + jid = Swift::JID(legacyName + "/Spectrum"); + } + boost::shared_ptr client = boost::make_shared(jid, password, m_factories); m_users[user] = client; client->setAlwaysTrustCertificates(); client->onConnected.connect(boost::bind(&SwiftenPlugin::handleSwiftConnected, this, user));