adium-1.4 2897:2beaaf6dc67c: Fix for Ticket #13731, Dueling Reso...
commits at adium.im
commits at adium.im
Wed Feb 3 03:55:58 UTC 2010
details: http://hg.adium.im/adium-1.4/rev/2beaaf6dc67c
revision: 2897:2beaaf6dc67c
author: jhildebr at cisco.com
date: Tue Feb 02 19:35:42 2010 -0700
Fix for Ticket #13731, Dueling Resources. Ensure that the real disconnect error is kept, and not over-ridden by subsequent socket errors.
Reviewed by Stephen Holt <sholt at adium.im>. Fixes #13731.
diffs (66 lines):
diff -r b94526ba05ad -r 2beaaf6dc67c Copyright.txt
--- a/Copyright.txt Mon Dec 14 16:00:37 2009 +1100
+++ b/Copyright.txt Tue Feb 02 19:35:42 2010 -0700
@@ -31,6 +31,7 @@
Christopher Harms
Jasper Hauser
Arno Hautala
+Joe Hildebrand
Stephen Holt
Peter Hosey
Adam Iser
diff -r b94526ba05ad -r 2beaaf6dc67c Frameworks/Adium Framework/Source/AIAbstractAccount.m
--- a/Frameworks/Adium Framework/Source/AIAbstractAccount.m Mon Dec 14 16:00:37 2009 +1100
+++ b/Frameworks/Adium Framework/Source/AIAbstractAccount.m Tue Feb 02 19:35:42 2010 -0700
@@ -1422,6 +1422,12 @@
*/
- (void)setLastDisconnectionError:(NSString *)inError
{
+ // If we already have an error, ignore the new one, unless
+ // we're resetting to nil.
+ if (lastDisconnectionError && inError) {
+ return;
+ }
+
if (lastDisconnectionError != inError) {
[lastDisconnectionError release];
lastDisconnectionError = [inError retain];
diff -r b94526ba05ad -r 2beaaf6dc67c Plugins/Purple Service/CBPurpleAccount.m
--- a/Plugins/Purple Service/CBPurpleAccount.m Mon Dec 14 16:00:37 2009 +1100
+++ b/Plugins/Purple Service/CBPurpleAccount.m Tue Feb 02 19:35:42 2010 -0700
@@ -1760,6 +1760,9 @@
{
finishedConnectProcess = NO;
+ // When we *start* to connect, ensure there is no previous error. Waiting until connection succeeds
+ // could lead to looping.
+ [self setLastDisconnectionError:nil];
[super connect];
//Ensure we have a purple account if one does not already exist
@@ -2091,7 +2094,14 @@
- (void)setLastDisconnectionReason:(PurpleConnectionError)reason
{
- lastDisconnectionReason = reason;
+ // Libpurple now calls this twice, once with the real error, and once when we're disconnected.
+ // Discard the second call.
+ // BE CAREFUL to always call setLastDisconnectionReason BEFORE setLastDisconnectionError
+ // for this to work.
+ if (!lastDisconnectionError)
+ {
+ lastDisconnectionReason = reason;
+ }
}
- (PurpleConnectionError)lastDisconnectionReason
@@ -2104,8 +2114,8 @@
*/
- (void)accountConnectionReportDisconnect:(NSString *)text withReason:(PurpleConnectionError)reason
{
+ [self setLastDisconnectionReason:reason];
[self setLastDisconnectionError:text];
- [self setLastDisconnectionReason:reason];
if (reason == PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED)
[self serverReportedInvalidPassword];
More information about the commits
mailing list