Changeset - 56de41bb976b
[Not reviewed]
0 1 0
Jan Kaluza - 10 years ago 2016-02-10 22:22:05
jkaluza@redhat.com
Swiften: Check if the legacyname contains the resource and do not append our in that case
1 file changed with 5 insertions and 1 deletions:
0 comments (0 inline, 0 general)
backends/swiften/main.cpp
Show inline comments
 
@@ -298,13 +298,17 @@ class SwiftenPlugin : public NetworkPlugin, Swift::XMPPParserClient {
 
		void handleSwiftenDataWritten(const Swift::SafeByteArray &data) {
 
			LOG4CXX_INFO(logger_xml, "XML OUT " << safeByteArrayToString(data));
 
		}
 

	
 
		void handleLoginRequest(const std::string &user, const std::string &legacyName, const std::string &password) {
 
			LOG4CXX_INFO(logger, user << ": connecting as " << legacyName);
 
			boost::shared_ptr<Swift::Client> client = boost::make_shared<Swift::Client>(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<Swift::Client> client = boost::make_shared<Swift::Client>(jid, password, m_factories);
 
			m_users[user] = client;
 
			client->setAlwaysTrustCertificates();
 
			client->onConnected.connect(boost::bind(&SwiftenPlugin::handleSwiftConnected, this, user));
 
			client->onDisconnected.connect(boost::bind(&SwiftenPlugin::handleSwiftDisconnected, this, user, _1));
 
			client->onMessageReceived.connect(boost::bind(&SwiftenPlugin::handleSwiftMessageReceived, this, user, _1));
 
			client->getRoster()->onInitialRosterPopulated.connect(boost::bind(&SwiftenPlugin::handleSwiftRosterReceived, this, user));
0 comments (0 inline, 0 general)