adium 3518:971dfe1ffbc0: Updated for the new connection security...

commits at adium.im commits at adium.im
Sun Nov 14 15:44:04 UTC 2010


details:	http://hg.adium.im/adium/rev/971dfe1ffbc0
revision:	3518:971dfe1ffbc0
author:		Evan Schoenberg
date:		Sun Nov 14 09:43:36 2010 -0600

Updated for the new connection security xmpp pref. Fixes #14297
(transplanted from 190b1c1948bfe83afc373d20816b1d140dba435d)

diffs (34 lines):

diff -r c700d3105427 -r 971dfe1ffbc0 Plugins/Purple Service/ESPurpleJabberAccount.m
--- a/Plugins/Purple Service/ESPurpleJabberAccount.m	Sun Nov 14 09:32:46 2010 -0600
+++ b/Plugins/Purple Service/ESPurpleJabberAccount.m	Sun Nov 14 09:43:36 2010 -0600
@@ -152,14 +152,24 @@
 	if (ftProxies.length) {
 		purple_account_set_string(account, "ft_proxies", [ftProxies UTF8String]);
 	}
+
+	/* We have 2 checkboxes in Adium 1.4.1 which combine to provide a single setting within libpurple, for historical reasons.
+	 * A later update should have new strings to describe this with a single drop-down labeled "Connection Security"
+	 *
+	 * Libpurple defaults to require_tls; we default to opportunistic_tls. Should we require it? -evands
+	 */
+	char *connectionSecurity;
+	forceOldSSL = [[self preferenceForKey:KEY_JABBER_FORCE_OLD_SSL group:GROUP_ACCOUNT_STATUS] boolValue];
+	requireTLS = [[self preferenceForKey:KEY_JABBER_REQUIRE_TLS group:GROUP_ACCOUNT_STATUS] boolValue];
 	
-	//Force old SSL usage? (off by default)
-	forceOldSSL = [[self preferenceForKey:KEY_JABBER_FORCE_OLD_SSL group:GROUP_ACCOUNT_STATUS] boolValue];
-	purple_account_set_bool(account, "old_ssl", forceOldSSL);
+	if (requireTLS)
+		connectionSecurity = "require_tls";
+	else if (forceOldSSL)
+		connectionSecurity = "old_ssl";
+	else 
+		connectionSecurity = "opportunistic_tls";
 
-	//Require SSL or TLS? (off by default)
-	requireTLS = [[self preferenceForKey:KEY_JABBER_REQUIRE_TLS group:GROUP_ACCOUNT_STATUS] boolValue];
-	purple_account_set_bool(account, "require_tls", requireTLS);
+	purple_account_set_string(account, "connection_security", connectionSecurity);
 
 	//Allow plaintext authorization over an unencrypted connection? Purple will prompt if this is NO and is needed.
 	allowPlaintext = [[self preferenceForKey:KEY_JABBER_ALLOW_PLAINTEXT group:GROUP_ACCOUNT_STATUS] boolValue];




More information about the commits mailing list