# HG changeset patch # User John Bailey # Date 1202789679 0 # Node ID b6fac84a09743694b8a1abacf15a2e023461656c # Parent f1fa491504eb0e8e1a0f18a54b0aa0b3d68108d1# Parent 9cce91512be198f730badc49fd0cac8b04ad70d5 merge of 'a86cc370be80c0a0f0688ae2dec4f55775779fa1' and 'ab91624a6e52a9d566b2d04f6c5aa6c78d6fafba' diff -r f1fa491504eb -r b6fac84a0974 libpurple/protocols/yahoo/yahoo.c --- a/libpurple/protocols/yahoo/yahoo.c Tue Feb 12 04:03:30 2008 +0000 +++ b/libpurple/protocols/yahoo/yahoo.c Tue Feb 12 04:14:39 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 f1fa491504eb -r b6fac84a0974 libpurple/protocols/yahoo/yahoo.h --- a/libpurple/protocols/yahoo/yahoo.h Tue Feb 12 04:03:30 2008 +0000 +++ b/libpurple/protocols/yahoo/yahoo.h Tue Feb 12 04:14:39 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 f1fa491504eb -r b6fac84a0974 libpurple/protocols/yahoo/yahoo_filexfer.c --- a/libpurple/protocols/yahoo/yahoo_filexfer.c Tue Feb 12 04:03:30 2008 +0000 +++ b/libpurple/protocols/yahoo/yahoo_filexfer.c Tue Feb 12 04:14:39 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; }