From 07402c4e3451f2084a1c3ddc5bacfb38a66899a7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Remko=20Tron=C3=A7on?= <git@el-tramo.be>
Date: Thu, 21 Oct 2010 20:17:56 +0200
Subject: Fixed authentication problems on reconnect.

Release-Notes: Fixed a bug where reconnecting to a different account after signout would fail authenticating.

diff --git a/Swift/Controllers/MainController.cpp b/Swift/Controllers/MainController.cpp
index d95557f..6b9c447 100644
--- a/Swift/Controllers/MainController.cpp
+++ b/Swift/Controllers/MainController.cpp
@@ -424,7 +424,9 @@ void MainController::performLoginFromCachedCredentials() {
 		/* In case we're in the middle of another login, make sure they don't overlap */
 		client_->disconnect();
 	}
-	if (boundJID_.isValid() && jid_.isBare()) {
+	/* If we logged in with a bare JID, and we have a full bound JID, re-login with the
+	 * bound JID to try and keep dynamically assigned resources */
+	if (boundJID_.isValid() && jid_.isBare() && boundJID_.toBare() == jid_) {
 		client_->connect(boundJID_);
 	} else {
 		client_->connect();
-- 
cgit v0.10.2-6-g49f6