# HG changeset patch # User John Bailey # Date 1202776225 0 # Node ID 9cce91512be198f730badc49fd0cac8b04ad70d5 # Parent 5411ca13b8786d350fac3e004455f5cff4e6eb46# Parent cc5b2a145652bfffcad3cb1d6f9158890e0309b1 propagate from branch 'im.pidgin.cpw.rekkanoryo.yahoop15ft' (head 722549d96d82fd56433f18b78bda898eef6a56ed) to branch 'im.pidgin.pidgin' (head 3639bb4d5d5a867f6bdb2a82be21e4887179b929) diff -r 5411ca13b878 -r 9cce91512be1 libpurple/protocols/yahoo/yahoo.c --- a/libpurple/protocols/yahoo/yahoo.c Mon Feb 11 00:50:42 2008 +0000 +++ b/libpurple/protocols/yahoo/yahoo.c Tue Feb 12 00:30:25 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); diff -r 5411ca13b878 -r 9cce91512be1 libpurple/protocols/yahoo/yahoo.h --- a/libpurple/protocols/yahoo/yahoo.h Mon Feb 11 00:50:42 2008 +0000 +++ b/libpurple/protocols/yahoo/yahoo.h Tue Feb 12 00:30:25 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 diff -r 5411ca13b878 -r 9cce91512be1 libpurple/protocols/yahoo/yahoo_filexfer.c --- a/libpurple/protocols/yahoo/yahoo_filexfer.c Mon Feb 11 00:50:42 2008 +0000 +++ b/libpurple/protocols/yahoo/yahoo_filexfer.c Tue Feb 12 00:30:25 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; }