adium 3535:13d5080c2da4: By popular request, move the ICQ SSL fa...

commits at adium.im commits at adium.im
Tue Nov 16 01:35:59 UTC 2010


details:	http://hg.adium.im/adium/rev/13d5080c2da4
revision:	3535:13d5080c2da4
author:		Evan Schoenberg
date:		Mon Nov 15 19:27:55 2010 -0600

By popular request, move the ICQ SSL failure handling to a prompt at connect time with options to continue or disable
(transplanted from 445310da9b43172beeed95704140e61b2f61c6ef)

diffs (55 lines):

diff -r 7f59e9267142 -r 13d5080c2da4 Plugins/Purple Service/CBPurpleAccount.h
--- a/Plugins/Purple Service/CBPurpleAccount.h	Mon Nov 15 19:06:03 2010 -0600
+++ b/Plugins/Purple Service/CBPurpleAccount.h	Mon Nov 15 19:27:55 2010 -0600
@@ -223,3 +223,7 @@
 - (void)chat:(AIChat *)inChat closedCustomEmoticon:(NSString *)inEmoticon;
 
 @end
+
+ at interface CBPurpleAccount (ForSubclasses)
+- (void)continueConnectWithConfiguredPurpleAccoun;
+ at end
diff -r 7f59e9267142 -r 13d5080c2da4 Plugins/Purple Service/ESPurpleICQAccount.m
--- a/Plugins/Purple Service/ESPurpleICQAccount.m	Mon Nov 15 19:06:03 2010 -0600
+++ b/Plugins/Purple Service/ESPurpleICQAccount.m	Mon Nov 15 19:27:55 2010 -0600
@@ -60,18 +60,31 @@
 	purple_account_set_bool(account, "web_aware", [[self preferenceForKey:KEY_ICQ_WEB_AWARE group:GROUP_ACCOUNT_STATUS] boolValue]);
 
 #warning Remove when ICQ SSL support is fixed
-	if ([[self preferenceForKey:PREFERENCE_SSL_CONNECTION
-						  group:GROUP_ACCOUNT_STATUS] boolValue]) {
-		NSRunCriticalAlertPanel(@"Secure connection to ICQ disabled",
-								@"Due to recent change with the ICQ service, SSL connections to ICQ are not currently supported. SSL has automatically been disabled.",
-								nil, nil, nil);
-		[self setPreference:nil
-					 forKey:PREFERENCE_SSL_CONNECTION
-					  group:GROUP_ACCOUNT_STATUS];
-	}
 	purple_account_set_bool(account, "use_ssl", NO);
 }
 
+- (void)continueConnectWithConfiguredPurpleAccount
+{
+	if ([[self preferenceForKey:PREFERENCE_SSL_CONNECTION
+						  group:GROUP_ACCOUNT_STATUS] boolValue]) {
+		NSInteger ret = NSRunCriticalAlertPanel(@"Secure Connection to ICQ Not Available",
+												 @"Due to recent changes with the ICQ service, SSL connections to ICQ are not currently supported. Do you want to disable SSL and connect without encryption?",
+												 @"Connect Without Encryption",
+												 @"Disable Account",
+												 nil);
+		
+		if (ret == NSAlertDefaultReturn) {
+			[self setPreference:nil
+						 forKey:PREFERENCE_SSL_CONNECTION
+						  group:GROUP_ACCOUNT_STATUS];
+			[super continueConnectWithConfiguredPurpleAccount];
+		} else {
+			[self setEnabled:NO];
+		}
+	} else {
+		[super continueConnectWithConfiguredPurpleAccount];	
+	}
+}
 
 #pragma mark Contact updates
 




More information about the commits mailing list