pidgin: 09828caa: Add a boolean account option (defaulting...

rekkanoryo at pidgin.im rekkanoryo at pidgin.im
Fri Aug 21 22:30:32 EDT 2009


-----------------------------------------------------------------
Revision: 09828caa4a3333f2f0eed91315c29d5b3aa66fcb
Ancestor: fa8093d6c7c64e3547718ca660ccaa10c2545250
Author: rekkanoryo at pidgin.im
Date: 2009-08-22T02:28:23
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/09828caa4a3333f2f0eed91315c29d5b3aa66fcb

Modified files:
        libpurple/protocols/yahoo/libyahoo.c
        libpurple/protocols/yahoo/libyahoojp.c
        libpurple/protocols/yahoo/libymsg.c

ChangeLog: 

Add a boolean account option (defaulting to off) to control whether to use
an account-specific proxy for Yahoo SSL connections.  Fixes #9488, I hope.

-------------- next part --------------
============================================================
--- libpurple/protocols/yahoo/libyahoo.c	edbe55a4e456ef702fcea77291ee77210e87aed4
+++ libpurple/protocols/yahoo/libyahoo.c	e23838eefed8d9932940f9d15fe9506e9cc6b4b1
@@ -321,12 +321,14 @@ init_plugin(PurplePlugin *plugin)
 	option = purple_account_option_string_new(_("Chat room locale"), "room_list_locale", YAHOO_ROOMLIST_LOCALE);
 	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
 
-	option = purple_account_option_bool_new(_("Ignore conference and chatroom invitations"), "ignore_invites", FALSE);
+	option = purple_account_option_string_new(_("Encoding"), "local_charset", "UTF-8");
 	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
 
-	option = purple_account_option_string_new(_("Encoding"), "local_charset", "UTF-8");
+	option = purple_account_option_bool_new(_("Ignore conference and chatroom invitations"), "ignore_invites", FALSE);
 	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
 
+	option = purple_account_option_bool_new(_("Use account proxy for SSL connections"), "proxy_ssl", FALSE);
+	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
 
 #if 0
 	option = purple_account_option_string_new(_("Chat room list URL"), "room_list", YAHOO_ROOMLIST_URL);
============================================================
--- libpurple/protocols/yahoo/libyahoojp.c	d76e5cf4139ccc6f0c284cf06a1387e8f709eec5
+++ libpurple/protocols/yahoo/libyahoojp.c	2684dc955d3dd9528250dce5180ba49418288844
@@ -217,12 +217,14 @@ init_plugin(PurplePlugin *plugin)
 	option = purple_account_option_string_new(_("Chat room locale"), "room_list_locale", YAHOOJP_ROOMLIST_LOCALE);
 	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
 
-	option = purple_account_option_bool_new(_("Ignore conference and chatroom invitations"), "ignore_invites", FALSE);
+	option = purple_account_option_string_new(_("Encoding"), "local_charset", "UTF-8");
 	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
 
-	option = purple_account_option_string_new(_("Encoding"), "local_charset", "UTF-8");
+	option = purple_account_option_bool_new(_("Ignore conference and chatroom invitations"), "ignore_invites", FALSE);
 	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
 
+	option = purple_account_option_bool_new(_("Use account proxy for SSL connections"), "proxy_ssl", FALSE);
+	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
 
 #if 0
 	option = purple_account_option_string_new(_("Chat room list URL"), "room_list", YAHOO_ROOMLIST_URL);
============================================================
--- libpurple/protocols/yahoo/libymsg.c	e15c747098a033957affc608406029519a9efc6d
+++ libpurple/protocols/yahoo/libymsg.c	784ea1f5c48533a4d0caa0bb180484436ba111a3
@@ -1839,11 +1839,12 @@ static void yahoo_auth16_stage1_cb(Purpl
 			PurpleAccount *account = purple_connection_get_account(gc);
 			char *url = NULL;
 			gboolean yahoojp = yahoo_is_japan(account);
+			gboolean proxy_ssl = purple_account_get_bool(account, "proxy_ssl", FALSE);
 
 			url = g_strdup_printf(yahoojp ? YAHOOJP_LOGIN_URL : YAHOO_LOGIN_URL, token);
-			url_data = purple_util_fetch_url_request_len_with_account(account, url,
-					TRUE, YAHOO_CLIENT_USERAGENT, TRUE, NULL, FALSE, -1,
-					yahoo_auth16_stage2, auth_data);
+			url_data = purple_util_fetch_url_request_len_with_account(
+					proxy_ssl ? account : NULL, url, TRUE, YAHOO_CLIENT_USERAGENT,
+					TRUE, NULL, FALSE, -1, yahoo_auth16_stage2, auth_data);
 			g_free(url);
 			g_free(token);
 		}
@@ -1852,12 +1853,14 @@ static void yahoo_auth16_stage1(PurpleCo
 
 static void yahoo_auth16_stage1(PurpleConnection *gc, const char *seed)
 {
+	PurpleAccount *account = purple_connection_get_account(gc);
 	PurpleUtilFetchUrlData *url_data = NULL;
 	struct yahoo_auth_data *auth_data = NULL;
 	char *url = NULL;
 	char *encoded_username;
 	char *encoded_password;
-	gboolean yahoojp;
+	gboolean yahoojp = yahoo_is_japan(account);
+	gboolean proxy_ssl = purple_account_get_bool(account, "proxy_ssl", FALSE);
 
 	purple_debug_info("yahoo", "Authentication: In yahoo_auth16_stage1\n");
 
@@ -1866,7 +1869,6 @@ static void yahoo_auth16_stage1(PurpleCo
 		return;
 	}
 
-	yahoojp = yahoo_is_japan(purple_connection_get_account(gc));
 	auth_data = g_new0(struct yahoo_auth_data, 1);
 	auth_data->gc = gc;
 	auth_data->seed = g_strdup(seed);
@@ -1879,7 +1881,7 @@ static void yahoo_auth16_stage1(PurpleCo
 	g_free(encoded_username);
 
 	url_data = purple_util_fetch_url_request_len_with_account(
-			purple_connection_get_account(gc), url, TRUE,
+			proxy_ssl ? account : NULL, url, TRUE,
 			YAHOO_CLIENT_USERAGENT, TRUE, NULL, FALSE, -1,
 			yahoo_auth16_stage1_cb, auth_data);
 


More information about the Commits mailing list