Mercurial > pidgin
comparison libgaim/protocols/yahoo/yahoo_packet.c @ 14446:1bee09450652
[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 <tailor@pidgin.im>
author | Evan Schoenberg <evan.s@dreskin.net> |
---|---|
date | Mon, 04 Sep 2006 21:58:49 +0000 |
parents | accae094598f |
children | 74511b8e9b46 |
comparison
equal
deleted
inserted
replaced
14445:b1a6effcb37a | 14446:1bee09450652 |
---|---|
292 gaim_circ_buffer_mark_read(yd->txbuf, ret); | 292 gaim_circ_buffer_mark_read(yd->txbuf, ret); |
293 } | 293 } |
294 | 294 |
295 | 295 |
296 size_t yahoo_packet_build(struct yahoo_packet *pkt, int pad, gboolean wm, | 296 size_t yahoo_packet_build(struct yahoo_packet *pkt, int pad, gboolean wm, |
297 guchar **buf) | 297 gboolean jp, guchar **buf) |
298 { | 298 { |
299 size_t pktlen = yahoo_packet_length(pkt); | 299 size_t pktlen = yahoo_packet_length(pkt); |
300 size_t len = YAHOO_PACKET_HDRLEN + pktlen; | 300 size_t len = YAHOO_PACKET_HDRLEN + pktlen; |
301 guchar *data; | 301 guchar *data; |
302 int pos = 0; | 302 int pos = 0; |
305 | 305 |
306 memcpy(data + pos, "YMSG", 4); pos += 4; | 306 memcpy(data + pos, "YMSG", 4); pos += 4; |
307 | 307 |
308 if (wm) | 308 if (wm) |
309 pos += yahoo_put16(data + pos, YAHOO_WEBMESSENGER_PROTO_VER); | 309 pos += yahoo_put16(data + pos, YAHOO_WEBMESSENGER_PROTO_VER); |
310 else if (jp) | |
311 pos += yahoo_put16(data + pos, YAHOO_PROTO_VER_JAPAN); | |
310 else | 312 else |
311 pos += yahoo_put16(data + pos, YAHOO_PROTO_VER); | 313 pos += yahoo_put16(data + pos, YAHOO_PROTO_VER); |
312 pos += yahoo_put16(data + pos, 0x0000); | 314 pos += yahoo_put16(data + pos, 0x0000); |
313 pos += yahoo_put16(data + pos, pktlen + pad); | 315 pos += yahoo_put16(data + pos, pktlen + pad); |
314 pos += yahoo_put16(data + pos, pkt->service); | 316 pos += yahoo_put16(data + pos, pkt->service); |
329 guchar *data; | 331 guchar *data; |
330 | 332 |
331 if (yd->fd < 0) | 333 if (yd->fd < 0) |
332 return -1; | 334 return -1; |
333 | 335 |
334 len = yahoo_packet_build(pkt, 0, yd->wm, &data); | 336 len = yahoo_packet_build(pkt, 0, yd->wm, yd->jp, &data); |
335 | 337 |
336 yahoo_packet_dump(data, len); | 338 yahoo_packet_dump(data, len); |
337 if (yd->txhandler == -1) | 339 if (yd->txhandler == -1) |
338 ret = write(yd->fd, data, len); | 340 ret = write(yd->fd, data, len); |
339 else { | 341 else { |