Mercurial > pidgin
comparison libpurple/protocols/qq/group_im.c @ 24651:2df1d0449ba6
Fix bug in send IM
author | Hu Yong <ccpaging@gmail.com> |
---|---|
date | Thu, 20 Nov 2008 06:12:10 +0000 |
parents | 2cfdcaf6b5f3 |
children | 59aae7636111 |
comparison
equal
deleted
inserted
replaced
24650:d18ab9118fd4 | 24651:2df1d0449ba6 |
---|---|
306 | 306 |
307 bytes = 0; | 307 bytes = 0; |
308 bytes += qq_put16(raw_data + bytes, 0); | 308 bytes += qq_put16(raw_data + bytes, 0); |
309 bytes += qq_putdata(raw_data + bytes, (guint8 *)msg, strlen(msg)); | 309 bytes += qq_putdata(raw_data + bytes, (guint8 *)msg, strlen(msg)); |
310 bytes += qq_put_im_tail(raw_data + bytes, fmt); | 310 bytes += qq_put_im_tail(raw_data + bytes, fmt); |
311 bytes += qq_put32(raw_data + bytes, 0); /* unknown 4 bytes */ | |
312 | |
313 /* reset first two bytes */ | 311 /* reset first two bytes */ |
314 qq_put16(raw_data, bytes - 2); | 312 qq_put16(raw_data, bytes - 2); |
315 | 313 |
316 qq_send_room_cmd(gc, QQ_ROOM_CMD_SEND_IM, room_id, raw_data, bytes); | 314 qq_send_room_cmd(gc, QQ_ROOM_CMD_SEND_IM, room_id, raw_data, bytes); |
317 } | 315 } |
354 bytes += qq_put_im_tail(raw_data + bytes, fmt); | 352 bytes += qq_put_im_tail(raw_data + bytes, fmt); |
355 } | 353 } |
356 | 354 |
357 /* reset first two bytes as length */ | 355 /* reset first two bytes as length */ |
358 qq_put16(raw_data, bytes - 2); | 356 qq_put16(raw_data, bytes - 2); |
359 | 357 |
360 /*qq_show_packet("QQ_ROOM_CMD_SEND_IM_EX", raw_data, bytes); */ | 358 /*qq_show_packet("QQ_ROOM_CMD_SEND_IM_EX", raw_data, bytes); */ |
361 qq_send_room_cmd(gc, QQ_ROOM_CMD_SEND_IM_EX, room_id, raw_data, bytes); | 359 qq_send_room_cmd(gc, QQ_ROOM_CMD_SEND_IM_EX, room_id, raw_data, bytes); |
362 } | 360 } |
363 | 361 |
364 /* send a chat msg to a QQ Qun | 362 /* send a chat msg to a QQ Qun |
413 | 411 |
414 qd->send_im_id++; | 412 qd->send_im_id++; |
415 fmt = qq_im_fmt_new_by_purple(what); | 413 fmt = qq_im_fmt_new_by_purple(what); |
416 frag_count = g_slist_length(segments); | 414 frag_count = g_slist_length(segments); |
417 frag_index = 0; | 415 frag_index = 0; |
418 /* | 416 /* |
419 if (frag_count <= 1) { | 417 if (frag_count <= 1) { |
420 */ | 418 */ |
421 for (it = segments; it; it = it->next) { | 419 for (it = segments; it; it = it->next) { |
422 request_room_send_im(gc, id, fmt, (gchar *)it->data); | 420 request_room_send_im(gc, id, fmt, (gchar *)it->data); |
423 g_free(it->data); | 421 g_free(it->data); |