adium-1.4 3453:260b42847138: Change ICQ and AIM encryption setti...

commits at adium.im commits at adium.im
Sun Apr 17 11:14:47 UTC 2011


details:	http://hg.adium.im/adium-1.4/rev/260b42847138
revision:	3453:260b42847138
branch:		(none)
author:		Thijs Alkemade <thijsalkemade at gmail.com>
date:		Sun Apr 17 12:51:21 2011 +0200

Change ICQ and AIM encryption settings to no/opportunistic/required encryption.

For ICQ, all accounts will be changed to opportunistic (as the SSL settings were wiped by 1.4.1).
For AIM, when SSL was on, encryption is now required. When SSL was off, encryption is now opportunistic.

Additionally, turn on clientLogin for AIM.

Fixes #15000
(transplanted from e9f94c290817c0c77fc71475826478218494665f)

diffs (205 lines):

diff -r 835e2efed0aa -r 260b42847138 Adium.xcodeproj/project.pbxproj
--- a/Adium.xcodeproj/project.pbxproj	Sun Apr 17 01:19:26 2011 +0200
+++ b/Adium.xcodeproj/project.pbxproj	Sun Apr 17 12:51:21 2011 +0200
@@ -9572,7 +9572,6 @@
 			};
 			buildConfigurationList = DADE8E3A085507450062B664 /* Build configuration list for PBXProject "Adium" */;
 			compatibilityVersion = "Xcode 3.1";
-			developmentRegion = English;
 			hasScannedForEncodings = 1;
 			knownRegions = (
 				en,
diff -r 835e2efed0aa -r 260b42847138 Plugins/Purple Service/AIPurpleOscarAccountViewController.h
--- a/Plugins/Purple Service/AIPurpleOscarAccountViewController.h	Sun Apr 17 01:19:26 2011 +0200
+++ b/Plugins/Purple Service/AIPurpleOscarAccountViewController.h	Sun Apr 17 12:51:21 2011 +0200
@@ -18,7 +18,7 @@
 
 @interface AIPurpleOscarAccountViewController : PurpleAccountViewController {
 	IBOutlet		NSButton						*checkBox_proxyServer;
-	IBOutlet		NSButton						*checkBox_SSL;
+	IBOutlet		NSMatrix						*radio_Encryption;
 }
 
 @end
diff -r 835e2efed0aa -r 260b42847138 Plugins/Purple Service/AIPurpleOscarAccountViewController.m
--- a/Plugins/Purple Service/AIPurpleOscarAccountViewController.m	Sun Apr 17 01:19:26 2011 +0200
+++ b/Plugins/Purple Service/AIPurpleOscarAccountViewController.m	Sun Apr 17 12:51:21 2011 +0200
@@ -19,17 +19,43 @@
 #import "CBPurpleOscarAccount.h"
 #import <Adium/AIAccount.h>
 
+ at interface AIPurpleOscarAccountViewController (PRIVATE)
++ (NSArray *)encryptionTypes;
+ at end
+
 @implementation AIPurpleOscarAccountViewController
 
++ (NSArray *)encryptionTypes
+{
+	static NSArray *encryptionTypes;
+	
+	if (!encryptionTypes) {
+		encryptionTypes = [[NSArray alloc] initWithObjects:PREFERENCE_ENCRYPTION_TYPE_NO,
+						   PREFERENCE_ENCRYPTION_TYPE_OPPORTUNISTIC, PREFERENCE_ENCRYPTION_TYPE_REQUIRED, nil];
+	}
+	
+	return encryptionTypes;
+}
+
 /*!
  * @brief Configure controls
  */
 - (void)configureForAccount:(AIAccount *)inAccount
 {
-    [super configureForAccount:inAccount];
+	[super configureForAccount:inAccount];
 	
 	[checkBox_proxyServer setState:[[account preferenceForKey:PREFERENCE_FT_PROXY_SERVER group:GROUP_ACCOUNT_STATUS] boolValue]];
-	[checkBox_SSL setState:[[account preferenceForKey:PREFERENCE_SSL_CONNECTION group:GROUP_ACCOUNT_STATUS] boolValue]];
+
+	for (NSButtonCell* cell in [radio_Encryption cells]) {
+		if ([[[AIPurpleOscarAccountViewController encryptionTypes] objectAtIndex:[cell tag]]
+			 isEqualToString:[account preferenceForKey:PREFERENCE_ENCRYPTION_TYPE
+												 group:GROUP_ACCOUNT_STATUS]]) {
+			[cell setState:NSOnState];
+		} else {
+			[cell setState:NSOffState];
+		}
+	}
+
 }
 
 /*!
@@ -43,9 +69,9 @@
 					forKey:PREFERENCE_FT_PROXY_SERVER
 					 group:GROUP_ACCOUNT_STATUS];
 	
-	[account setPreference:[NSNumber numberWithBool:[checkBox_SSL state]]
-					forKey:PREFERENCE_SSL_CONNECTION
-					 group:GROUP_ACCOUNT_STATUS];	
+	[account setPreference:[[AIPurpleOscarAccountViewController encryptionTypes] objectAtIndex:[radio_Encryption selectedTag]]
+			forKey:PREFERENCE_ENCRYPTION_TYPE
+			 group:GROUP_ACCOUNT_STATUS];	
 }
 
 @end
diff -r 835e2efed0aa -r 260b42847138 Plugins/Purple Service/CBPurpleOscarAccount.h
--- a/Plugins/Purple Service/CBPurpleOscarAccount.h	Sun Apr 17 01:19:26 2011 +0200
+++ b/Plugins/Purple Service/CBPurpleOscarAccount.h	Sun Apr 17 12:51:21 2011 +0200
@@ -29,8 +29,16 @@
 #define OSCAR_STATUS_ID_CUSTOM		"custom"
 
 #define PREFERENCE_FT_PROXY_SERVER	@"Always Use FT Proxy"
+
+// obsolete, migrate to PREFERENCE_ENCRYPTION_TYPE
 #define PREFERENCE_SSL_CONNECTION	@"Connect Using SSL"
 
+#define PREFERENCE_ENCRYPTION_TYPE	@"Encryption Type"
+
+#define PREFERENCE_ENCRYPTION_TYPE_OPPORTUNISTIC @"Opportunistic Encryption"
+#define PREFERENCE_ENCRYPTION_TYPE_REQUIRED @"Require Encryption"
+#define PREFERENCE_ENCRYPTION_TYPE_NO @"No Encryption"
+
 @interface CBPurpleOscarAccount : CBPurpleAccount  <AIAccount_Files> {
 	NSTimer			*delayedSignonUpdateTimer;
 	NSMutableArray  *arrayOfContactsForDelayedUpdates;
diff -r 835e2efed0aa -r 260b42847138 Plugins/Purple Service/CBPurpleOscarAccount.m
--- a/Plugins/Purple Service/CBPurpleOscarAccount.m	Sun Apr 17 01:19:26 2011 +0200
+++ b/Plugins/Purple Service/CBPurpleOscarAccount.m	Sun Apr 17 12:51:21 2011 +0200
@@ -46,6 +46,9 @@
 
 @interface CBPurpleOscarAccount ()
 - (NSString *)stringByProcessingImgTagsForDirectIM:(NSString *)inString forContactWithUID:(const char *)who;
+
+// migration from 1.4.1 to 1.4.2
+- (void)migrateSSL;
 @end
 
 @implementation CBPurpleOscarAccount
@@ -149,12 +152,29 @@
 	
 	purple_account_set_bool(account, "always_use_rv_proxy", [[self preferenceForKey:PREFERENCE_FT_PROXY_SERVER
 																			  group:GROUP_ACCOUNT_STATUS] boolValue]);
-
-	purple_account_set_bool(account, "use_ssl", [[self preferenceForKey:PREFERENCE_SSL_CONNECTION
-																  group:GROUP_ACCOUNT_STATUS] boolValue]);
 	
-	purple_account_set_bool(account, "use_clientlogin", FALSE);
+		
+	// Always yes, so SSL on ICQ works again.
+	purple_account_set_bool(account, "use_clientlogin", TRUE);
 	
+	// Migrate from SSL/no SSL to the tri-state popup button 
+	if (![self preferenceForKey:PREFERENCE_ENCRYPTION_TYPE group:GROUP_ACCOUNT_STATUS]) {
+		[self migrateSSL];
+		[self setPreference:nil forKey:PREFERENCE_SSL_CONNECTION group:GROUP_ACCOUNT_STATUS];
+	}
+	
+	if ([[self preferenceForKey:PREFERENCE_ENCRYPTION_TYPE group:GROUP_ACCOUNT_STATUS] isEqualToString:PREFERENCE_ENCRYPTION_TYPE_OPPORTUNISTIC]) {
+		purple_account_set_string(account, "encryption", "opportunistic_encryption");
+	} else if ([[self preferenceForKey:PREFERENCE_ENCRYPTION_TYPE group:GROUP_ACCOUNT_STATUS] isEqualToString:PREFERENCE_ENCRYPTION_TYPE_REQUIRED]) {
+		purple_account_set_string(account, "encryption", "require_encryption");
+	} else {
+		purple_account_set_string(account, "encryption", "no_encryption");
+	}
+}
+	
+- (void)migrateSSL
+{
+	// ICQ and AIM should override this
 }
 
 - (BOOL)encrypted
diff -r 835e2efed0aa -r 260b42847138 Plugins/Purple Service/ESPurpleAIMAccount.m
--- a/Plugins/Purple Service/ESPurpleAIMAccount.m	Sun Apr 17 01:19:26 2011 +0200
+++ b/Plugins/Purple Service/ESPurpleAIMAccount.m	Sun Apr 17 12:51:21 2011 +0200
@@ -43,6 +43,19 @@
 	[adium.preferenceController registerPreferenceObserver:self forGroup:PREF_GROUP_NOTES];
 }
 
+- (void)migrateSSL
+{
+	if ([self preferenceForKey:PREFERENCE_SSL_CONNECTION group:GROUP_ACCOUNT_STATUS]) {
+		[self setPreference:PREFERENCE_ENCRYPTION_TYPE_REQUIRED
+					 forKey:PREFERENCE_ENCRYPTION_TYPE
+					  group:GROUP_ACCOUNT_STATUS];
+	} else {
+		[self setPreference:PREFERENCE_ENCRYPTION_TYPE_OPPORTUNISTIC
+					 forKey:PREFERENCE_ENCRYPTION_TYPE
+					  group:GROUP_ACCOUNT_STATUS];
+	}
+}
+
 - (void)dealloc
 {
 	[adium.preferenceController unregisterPreferenceObserver:self];
diff -r 835e2efed0aa -r 260b42847138 Plugins/Purple Service/ESPurpleICQAccount.m
--- a/Plugins/Purple Service/ESPurpleICQAccount.m	Sun Apr 17 01:19:26 2011 +0200
+++ b/Plugins/Purple Service/ESPurpleICQAccount.m	Sun Apr 17 12:51:21 2011 +0200
@@ -58,15 +58,14 @@
 	
 	//Defaults to NO - web_aware will cause lots of spam for many users!
 	purple_account_set_bool(account, "web_aware", [[self preferenceForKey:KEY_ICQ_WEB_AWARE group:GROUP_ACCOUNT_STATUS] boolValue]);
+}
 
-	// Always yes, so SSL works again.
-	purple_account_set_bool(account, "use_clientlogin", TRUE);
-	
-	if ([[self preferenceForKey:PREFERENCE_SSL_CONNECTION group:GROUP_ACCOUNT_STATUS] boolValue]) {
-		purple_account_set_string(account, "encryption", "opportunistic_encryption");
-	} else {
-		purple_account_set_string(account, "encryption", "no_encryption");
-	}
+- (void)migrateSSL
+{
+	// SSL was forced off in the 1.4.1 update. Because "require SSL" will fail, migrate everyone to opportunistic encryption
+	[self setPreference:PREFERENCE_ENCRYPTION_TYPE_OPPORTUNISTIC
+				 forKey:PREFERENCE_ENCRYPTION_TYPE
+				  group:GROUP_ACCOUNT_STATUS];
 }
 
 #pragma mark Contact updates
diff -r 835e2efed0aa -r 260b42847138 Plugins/Purple Service/en.lproj/ESPurpleAIMAccountView.nib/keyedobjects.nib
Binary file Plugins/Purple Service/en.lproj/ESPurpleAIMAccountView.nib/keyedobjects.nib has changed
diff -r 835e2efed0aa -r 260b42847138 Plugins/Purple Service/en.lproj/ESPurpleICQAccountView.nib/keyedobjects.nib
Binary file Plugins/Purple Service/en.lproj/ESPurpleICQAccountView.nib/keyedobjects.nib has changed




More information about the commits mailing list