changeset 22271:cc5b2a145652

Simplified version of the newest patch on #4533 to not try Yahoo protocol version 15 file transfer on Yahoo Japan.
author John Bailey <rekkanoryo@rekkanoryo.org>
date Wed, 06 Feb 2008 18:06:44 +0000
parents 762174f38807
children 9cce91512be1
files libpurple/protocols/yahoo/yahoo.c libpurple/protocols/yahoo/yahoo.h libpurple/protocols/yahoo/yahoo_filexfer.c
diffstat 3 files changed, 60 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/yahoo/yahoo.c	Wed Feb 06 15:50:41 2008 +0000
+++ b/libpurple/protocols/yahoo/yahoo.c	Wed Feb 06 18:06:44 2008 +0000
@@ -1471,13 +1471,24 @@
 	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 @@
 	}
 	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);
 
--- a/libpurple/protocols/yahoo/yahoo.h	Wed Feb 06 15:50:41 2008 +0000
+++ b/libpurple/protocols/yahoo/yahoo.h	Wed Feb 06 18:06:44 2008 +0000
@@ -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,6 +76,15 @@
 
 #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
--- a/libpurple/protocols/yahoo/yahoo_filexfer.c	Wed Feb 06 15:50:41 2008 +0000
+++ b/libpurple/protocols/yahoo/yahoo_filexfer.c	Wed Feb 06 18:06:44 2008 +0000
@@ -1033,18 +1033,19 @@
 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 @@
 		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;
 	}