cpw.sulabh.yahoo_16: a6ccff1d: Support logging into Yahoo! Japan with p...

rekkanoryo at pidgin.im rekkanoryo at pidgin.im
Mon May 11 23:05:37 EDT 2009


-----------------------------------------------------------------
Revision: a6ccff1d5368c712499f9b2f3671fa017f8efca2
Ancestor: 398170eb3baade1ddeeca492dbb74d023c6d8a27
Author: rekkanoryo at pidgin.im
Date: 2009-05-12T00:50:45
Branch: im.pidgin.cpw.sulabh.yahoo_16
URL: http://d.pidgin.im/viewmtn/revision/info/a6ccff1d5368c712499f9b2f3671fa017f8efca2

Modified files:
        libpurple/protocols/yahoo/yahoo.c
        libpurple/protocols/yahoo/yahoo.h

ChangeLog: 

Support logging into Yahoo! Japan with protocol 16.  It seems not to care
what version bytes are sent once you use the right URL's to log in.

-------------- next part --------------
============================================================
--- libpurple/protocols/yahoo/yahoo.c	0a2ae02c9798c43ff1891a28cfbde2976e761ce6
+++ libpurple/protocols/yahoo/yahoo.c	23309573ae5fa3e2ca0942d5fcbd38370a4a46aa
@@ -1776,7 +1776,14 @@ static void yahoo_auth16_stage1_cb(Purpl
 		}
 		else	{
 			/* OK to login, correct information provided */
-			char *url = g_strdup_printf("https://login.yahoo.com/config/pwtoken_login?src=ymsgr&ts=&token=%s",token);
+			char *url = NULL;
+			gboolean yahoojp = purple_account_get_bool(purple_connection_get_account(gc),
+				"yahoojp", 0);
+
+			url = g_strdup_printf(yahoojp ?
+					"https://login.yahoo.co.jp/config/pwtoken_login?src=ymsgr&ts=&token=%s" : 
+					"https://login.yahoo.com/config/pwtoken_login?src=ymsgr&ts=&token=%s",
+					token);
 			url_data2 = purple_util_fetch_url_request(url, TRUE, "Mozilla/4.0 (compatible; MSIE 5.5)", TRUE, NULL, FALSE, yahoo_auth16_stage2, auth_data);
 			g_free(url);
 			g_free(token);
@@ -1786,9 +1793,10 @@ static void yahoo_auth16_stage1(PurpleCo
 
 static void yahoo_auth16_stage1(PurpleConnection *gc, const char *seed)
 {
-	PurpleUtilFetchUrlData *url_data;
+	PurpleUtilFetchUrlData *url_data = NULL;
 	struct yahoo_auth_data *auth_data = NULL;
 	char *url = NULL;
+	gboolean yahoojp;
 
 	purple_debug_info("yahoo","Authentication: In yahoo_auth16_stage1\n");
 
@@ -1797,11 +1805,17 @@ static void yahoo_auth16_stage1(PurpleCo
 		return;
 	}
 
+	yahoojp =  purple_account_get_bool(purple_connection_get_account(gc),
+			"yahoojp", 0);
 	auth_data = g_new0(struct yahoo_auth_data, 1);
 	auth_data->gc = gc;
 	auth_data->seed = g_strdup(seed);
 
-	url = g_strdup_printf("https://login.yahoo.com/config/pwtoken_get?src=ymsgr&ts=&login=%s&passwd=%s&chal=%s",purple_account_get_username(purple_connection_get_account(gc)), purple_connection_get_password(gc), seed);
+	url = g_strdup_printf(yahoojp ?
+			"https://login.yahoo.co.jp/config/pwtoken_get?src=ymsgr&ts=&login=%s&passwd=%s&chal=%s" :
+			"https://login.yahoo.com/config/pwtoken_get?src=ymsgr&ts=&login=%s&passwd=%s&chal=%s",
+			purple_account_get_username(purple_connection_get_account(gc)),
+			purple_connection_get_password(gc), seed);
 
 	url_data = purple_util_fetch_url_request(url, TRUE, "Mozilla/4.0 (compatible; MSIE 5.5)", TRUE, NULL, FALSE, yahoo_auth16_stage1_cb, auth_data);
 	g_free(url);
============================================================
--- libpurple/protocols/yahoo/yahoo.h	b419a255b56b09e4bff8143dbe268a1338a9db75
+++ libpurple/protocols/yahoo/yahoo.h	2d9e5f2af34a5e83c24fbfd6f2a9fcf9126aeed5
@@ -82,8 +82,8 @@
 #define YAHOO_CLIENT_VERSION_ID "4194239"
 #define YAHOO_CLIENT_VERSION "9.0.0.2152"
 
-#define YAHOOJP_CLIENT_VERSION_ID "524223"
-#define YAHOOJP_CLIENT_VERSION "7,0,1,1"
+#define YAHOOJP_CLIENT_VERSION_ID "4194239"
+#define YAHOOJP_CLIENT_VERSION "9.0.0.2152"
 
 /* Index into attention types list. */
 #define YAHOO_BUZZ 0


More information about the Commits mailing list