# HG changeset patch # User Evan Schoenberg # Date 1157407129 0 # Node ID 1bee09450652711955a3e3f4c114492e590bc2a5 # Parent b1a6effcb37a79a58d025bb52e1a99003f6c2f79 [gaim-migrate @ 17160] This patch was mentioned by Mark on gaim-devel; Tim replied, "That sounds good. As long as they're both #define's I can easily change." which they are :) Yahoo! Japan appears to not support - or at least not support in its current iteration -- the new Yahoo protocol version (0x000f), disconnecting us immediately if we send it. When connecting to Yahoo Japan, we now send the old version, (0x000c). committer: Tailor Script diff -r b1a6effcb37a -r 1bee09450652 libgaim/protocols/yahoo/yahoo_filexfer.c --- a/libgaim/protocols/yahoo/yahoo_filexfer.c Mon Sep 04 08:19:17 2006 +0000 +++ b/libgaim/protocols/yahoo/yahoo_filexfer.c Mon Sep 04 21:58:49 2006 +0000 @@ -212,7 +212,7 @@ content_length = YAHOO_PACKET_HDRLEN + yahoo_packet_length(pkt); - pkt_buf_len = yahoo_packet_build(pkt, 8, FALSE, &pkt_buf); + pkt_buf_len = yahoo_packet_build(pkt, 8, FALSE, yd->jp, &pkt_buf); yahoo_packet_free(pkt); host = gaim_account_get_string(account, "xfer_host", YAHOO_XFER_HOST); diff -r b1a6effcb37a -r 1bee09450652 libgaim/protocols/yahoo/yahoo_packet.c --- a/libgaim/protocols/yahoo/yahoo_packet.c Mon Sep 04 08:19:17 2006 +0000 +++ b/libgaim/protocols/yahoo/yahoo_packet.c Mon Sep 04 21:58:49 2006 +0000 @@ -294,7 +294,7 @@ size_t yahoo_packet_build(struct yahoo_packet *pkt, int pad, gboolean wm, - guchar **buf) + gboolean jp, guchar **buf) { size_t pktlen = yahoo_packet_length(pkt); size_t len = YAHOO_PACKET_HDRLEN + pktlen; @@ -307,6 +307,8 @@ if (wm) pos += yahoo_put16(data + pos, YAHOO_WEBMESSENGER_PROTO_VER); + else if (jp) + pos += yahoo_put16(data + pos, YAHOO_PROTO_VER_JAPAN); else pos += yahoo_put16(data + pos, YAHOO_PROTO_VER); pos += yahoo_put16(data + pos, 0x0000); @@ -331,7 +333,7 @@ if (yd->fd < 0) return -1; - len = yahoo_packet_build(pkt, 0, yd->wm, &data); + len = yahoo_packet_build(pkt, 0, yd->wm, yd->jp, &data); yahoo_packet_dump(data, len); if (yd->txhandler == -1) diff -r b1a6effcb37a -r 1bee09450652 libgaim/protocols/yahoo/yahoo_packet.h --- a/libgaim/protocols/yahoo/yahoo_packet.h Mon Sep 04 08:19:17 2006 +0000 +++ b/libgaim/protocols/yahoo/yahoo_packet.h Mon Sep 04 21:58:49 2006 +0000 @@ -117,6 +117,7 @@ #define YAHOO_WEBMESSENGER_PROTO_VER 0x0065 #define YAHOO_PROTO_VER 0x000f +#define YAHOO_PROTO_VER_JAPAN 0x000c #define YAHOO_PACKET_HDRLEN (4 + 2 + 2 + 2 + 2 + 4 + 4) @@ -127,7 +128,7 @@ void yahoo_packet_hash_int(struct yahoo_packet *pkt, int key, int value); int yahoo_packet_send(struct yahoo_packet *pkt, struct yahoo_data *yd); int yahoo_packet_send_and_free(struct yahoo_packet *pkt, struct yahoo_data *yd); -size_t yahoo_packet_build(struct yahoo_packet *pkt, int pad, gboolean wm, +size_t yahoo_packet_build(struct yahoo_packet *pkt, int pad, gboolean wm, gboolean jp, guchar **buf); void yahoo_packet_read(struct yahoo_packet *pkt, const guchar *data, int len); void yahoo_packet_write(struct yahoo_packet *pkt, guchar *data); diff -r b1a6effcb37a -r 1bee09450652 libgaim/protocols/yahoo/yahoo_picture.c --- a/libgaim/protocols/yahoo/yahoo_picture.c Mon Sep 04 08:19:17 2006 +0000 +++ b/libgaim/protocols/yahoo/yahoo_picture.c Mon Sep 04 21:58:49 2006 +0000 @@ -481,7 +481,7 @@ /* There's no magic here, we just need to prepend in reverse order */ g_string_prepend(d->str, "29\xc0\x80"); - pkt_buf_len = yahoo_packet_build(pkt, 8, FALSE, &pkt_buf); + pkt_buf_len = yahoo_packet_build(pkt, 8, FALSE, yd->jp, &pkt_buf); yahoo_packet_free(pkt); g_string_prepend_len(d->str, (char *)pkt_buf, pkt_buf_len); g_free(pkt_buf);