im.pidgin.cpw.rekkanoryo.yahoop15ft: 722549d96d82fd56433f18b78bda898eef6a56ed

rekkanoryo at pidgin.im rekkanoryo at pidgin.im
Wed Feb 6 13:10:41 EST 2008


-----------------------------------------------------------------
Revision: 722549d96d82fd56433f18b78bda898eef6a56ed
Ancestor: 16d99d9757384d801e4f13d991cb769a71f9c190
Author: rekkanoryo at pidgin.im
Date: 2008-02-06T18:06:44
Branch: im.pidgin.cpw.rekkanoryo.yahoop15ft
URL: http://d.pidgin.im/viewmtn/revision/info/722549d96d82fd56433f18b78bda898eef6a56ed

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

ChangeLog: 

Simplified version of the newest patch on #4533 to not try Yahoo protocol
version 15 file transfer on Yahoo Japan.

-------------- next part --------------
============================================================
--- libpurple/protocols/yahoo/yahoo.c	cd482c6914ef3824dcaac891df6cb36009f9b46e
+++ libpurple/protocols/yahoo/yahoo.c	df0543359928b73823b7122f1175638728b83def
@@ -1471,13 +1471,24 @@ static void yahoo_process_auth_old(Purpl
 	to_y64(result96, digest, 16);
 
 	pack = yahoo_packet_new(YAHOO_SERVICE_AUTHRESP,	YAHOO_STATUS_AVAILABLE, 0);
-	yahoo_packet_hash(pack, "ssssss",
-					  0, name,
-					  6, result6,
-					  96, result96,
-					  1, name,
-					  244, YAHOO_CLIENT_VERSION_ID,
-					  135, YAHOO_CLIENT_VERSION);
+
+	if(yd->jp) {
+		yahoo_packet_hash(pack, "sssss",
+						  0, name,
+						  6, result6,
+						  96, result96,
+						  1, name,
+						  135, YAHOOJP_CLIENT_VERSION);
+	} else {
+		yahoo_packet_hash(pack, "ssssss",
+						  0, name,
+						  6, result6,
+						  96, result96,
+						  1, name,
+						  244, YAHOO_CLIENT_VERSION_ID,
+						  135, YAHOO_CLIENT_VERSION);
+	}
+
 	yahoo_packet_send_and_free(pack, yd);
 
 	g_free(hash_string_p);
@@ -1923,13 +1934,24 @@ static void yahoo_process_auth_new(Purpl
 	}
 	purple_debug_info("yahoo", "yahoo status: %d\n", yd->current_status);
 	pack = yahoo_packet_new(YAHOO_SERVICE_AUTHRESP,	yd->current_status, 0);
-	yahoo_packet_hash(pack, "ssssss",
-					  0, name,
-					  6, resp_6,
-					  96, resp_96,
-					  1, name,
-					  244, YAHOO_CLIENT_VERSION_ID,
-					  135, YAHOO_CLIENT_VERSION);
+
+	if(yd->jp) {
+		yahoo_packet_hash(pack, "sssss",
+						  0, name,
+						  6, resp_6,
+						  96, resp_96,
+						  1, name,
+						  135, YAHOOJP_CLIENT_VERSION);
+	} else {
+		yahoo_packet_hash(pack, "ssssss",
+						  0, name,
+						  6, resp_6,
+						  96, resp_96,
+						  1, name,
+						  244, YAHOO_CLIENT_VERSION_ID,
+						  135, YAHOO_CLIENT_VERSION);
+	}
+
 	if (yd->picture_checksum)
 		yahoo_packet_hash_int(pack, 192, yd->picture_checksum);
 
============================================================
--- libpurple/protocols/yahoo/yahoo.h	aec1b7b8d40b59d05e2fe3c508059bdbaaf26b30
+++ libpurple/protocols/yahoo/yahoo.h	8fb0c92f1a12146719e9cfa04f9f763e9b1760eb
@@ -46,7 +46,7 @@
 #define YAHOOJP_XFER_HOST "filetransfer.msg.yahoo.co.jp"
 #define YAHOOJP_WEBCAM_HOST "wc.yahoo.co.jp"
 /*not sure, must test:*/
-#define YAHOOJP_XFER_RELAY_HOST "relay.msg.yahoo.com" 
+#define YAHOOJP_XFER_RELAY_HOST "relay.msg.yahoo.co.jp" 
 #define YAHOOJP_XFER_RELAY_PORT 80
 #define YAHOOJP_ROOMLIST_URL "http://insider.msg.yahoo.co.jp/ycontent/"
 #define YAHOOJP_ROOMLIST_LOCALE "ja"
@@ -76,7 +76,16 @@
 
 #define YAHOO_CLIENT_VERSION_ID "2097087"
 #define YAHOO_CLIENT_VERSION "8.1.0.421"
+#define YAHOOJP_CLIENT_VERSION "6,0,0,1710"
 
+#if 0
+/* The following were observed with the Yahoo Japan client current as of January
+ * 2008, but appear not to work correctly for file transfer.  Here as reference */
+# define YAHOOJP_CLIENT_VERSION_ID "524223"
+# define YAHOOJP_CLIENT_VERSION "7,0,1,1"
+#endif
+
+
 /* Index into attention types list. */
 #define YAHOO_BUZZ 0
 
============================================================
--- libpurple/protocols/yahoo/yahoo_filexfer.c	a6555cf3c92d8e810ac2f94865a68ddc8bfeb966
+++ libpurple/protocols/yahoo/yahoo_filexfer.c	781119f6911c43edc1d6046cb10069ab6b2b1ab1
@@ -1033,18 +1033,19 @@ void yahoo_send_file(PurpleConnection *g
 void yahoo_send_file(PurpleConnection *gc, const char *who, const char *file)
 {
 	struct yahoo_xfer_data *xfer_data;
-	struct yahoo_data *yd;
+	struct yahoo_data *yd = gc->proto_data;
 	int ver = 0;
 	PurpleXfer *xfer = yahoo_new_xfer(gc, who);
 	YahooFriend *yf = yahoo_friend_find(gc, who);
 
-	/* To determine whether client uses ymsg 15 i.e. client is higher than YM 7 */
-	if(yf && yf->version_id > 500000)
-		ver=15; 
+	/* To determine if we should use yahoo p15 for transfer.  Check other user's
+	 * reported version, but if we're on Yahoo Japan, ignore it. */
+	if(yf && yf->version_id > 500000 && !yd->jp)
+		ver = 15; 
+
 	g_return_if_fail(xfer != NULL);
 
 	if(ver == 15) {
-		yd = gc->proto_data;
 		xfer_data = xfer->data;
 		xfer_data->status_15 = STARTED;
 		purple_xfer_set_init_fnc(xfer, yahoo_xfer_init_15);
@@ -1320,17 +1321,21 @@ void yahoo_process_filetrans_15(PurpleCo
 		if(!xfer)
 			return;
 		/*
-		*	In the file trans info packet tht we must reply with , we are supposed to mention the ip address...
+		*	In the file trans info packet that we must reply with, we are
+		*	supposed to mention the ip address...
 		*	purple connect does not give me a way of finding the ip address...
-		*	so, purple dnsquery is used... but retries, trying with next ip address etc. is not implemented..TODO
+		*	so, purple dnsquery is used... but retries, trying with next ip
+		*	address etc. is not implemented..TODO
 		*/
 		if (yd->jp)
 		{
-			purple_dnsquery_a(YAHOOJP_XFER_RELAY_HOST, YAHOOJP_XFER_RELAY_PORT, yahoo_xfer_dns_connected_15, xfer);
+			purple_dnsquery_a(YAHOOJP_XFER_RELAY_HOST, YAHOOJP_XFER_RELAY_PORT,
+							yahoo_xfer_dns_connected_15, xfer);
 		}
 		else
 		{
-			purple_dnsquery_a(YAHOO_XFER_RELAY_HOST, YAHOO_XFER_RELAY_PORT, yahoo_xfer_dns_connected_15, xfer);
+			purple_dnsquery_a(YAHOO_XFER_RELAY_HOST, YAHOO_XFER_RELAY_PORT,
+							yahoo_xfer_dns_connected_15, xfer);
 		}
 		return;
 	}


More information about the Commits mailing list