comparison libpurple/protocols/qq/buddy_list.c @ 25947:4b8c4870b13a

propagate from branch 'im.pidgin.pidgin.next.minor' (head 7305b29db7bd00d3261f348c71674c93aa31b327) to branch 'im.pidgin.pidgin' (head d8c03c68d591d9392607d954942ee58b8618d946)
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Mon, 02 Mar 2009 04:18:40 +0000
parents 716b14deee97 d673ccc44a6e
children dd55229f634a
comparison
equal deleted inserted replaced
25946:8998ca47e6d0 25947:4b8c4870b13a
29 #include "debug.h" 29 #include "debug.h"
30 #include "notify.h" 30 #include "notify.h"
31 #include "utils.h" 31 #include "utils.h"
32 #include "packet_parse.h" 32 #include "packet_parse.h"
33 #include "buddy_info.h" 33 #include "buddy_info.h"
34 #include "buddy_memo.h"
34 #include "buddy_list.h" 35 #include "buddy_list.h"
35 #include "buddy_opt.h" 36 #include "buddy_opt.h"
36 #include "char_conv.h" 37 #include "char_conv.h"
37 #include "qq_define.h" 38 #include "qq_define.h"
38 #include "qq_base.h" 39 #include "qq_base.h"
53 guint16 unknown2; 54 guint16 unknown2;
54 guint8 ending; /* 0x00 */ 55 guint8 ending; /* 0x00 */
55 } qq_buddy_online; 56 } qq_buddy_online;
56 57
57 /* get a list of online_buddies */ 58 /* get a list of online_buddies */
58 void qq_request_get_buddies_online(PurpleConnection *gc, guint8 position, gint update_class) 59 void qq_request_get_buddies_online(PurpleConnection *gc, guint8 position, guint32 update_class)
59 { 60 {
60 qq_data *qd; 61 qq_data *qd;
61 guint8 *raw_data; 62 guint8 *raw_data;
62 gint bytes = 0; 63 gint bytes = 0;
63 64
79 qq_send_cmd_mess(gc, QQ_CMD_GET_BUDDIES_ONLINE, raw_data, 5, update_class, 0); 80 qq_send_cmd_mess(gc, QQ_CMD_GET_BUDDIES_ONLINE, raw_data, 5, update_class, 0);
80 } 81 }
81 82
82 /* position starts with 0x0000, 83 /* position starts with 0x0000,
83 * server may return a position tag if list is too long for one packet */ 84 * server may return a position tag if list is too long for one packet */
84 void qq_request_get_buddies(PurpleConnection *gc, guint16 position, gint update_class) 85 void qq_request_get_buddies(PurpleConnection *gc, guint16 position, guint32 update_class)
85 { 86 {
86 qq_data *qd; 87 qq_data *qd;
87 guint8 raw_data[16] = {0}; 88 guint8 raw_data[16] = {0};
88 gint bytes = 0; 89 gint bytes = 0;
89 90
103 104
104 qq_send_cmd_mess(gc, QQ_CMD_GET_BUDDIES_LIST, raw_data, bytes, update_class, 0); 105 qq_send_cmd_mess(gc, QQ_CMD_GET_BUDDIES_LIST, raw_data, bytes, update_class, 0);
105 } 106 }
106 107
107 /* get all list, buddies & Quns with groupsid support */ 108 /* get all list, buddies & Quns with groupsid support */
108 void qq_request_get_buddies_and_rooms(PurpleConnection *gc, guint32 position, gint update_class) 109 void qq_request_get_buddies_and_rooms(PurpleConnection *gc, guint32 position, guint32 update_class)
109 { 110 {
110 guint8 raw_data[16] = {0}; 111 guint8 raw_data[16] = {0};
111 gint bytes = 0; 112 gint bytes = 0;
112 113
113 /* 0x01 download, 0x02, upload */ 114 /* 0x01 download, 0x02, upload */
344 345
345 g_memmove(purple_buddy_get_protocol_data(buddy), &bd, sizeof(qq_buddy_data)); 346 g_memmove(purple_buddy_get_protocol_data(buddy), &bd, sizeof(qq_buddy_data));
346 /* nickname has been copy to buddy_data do not free 347 /* nickname has been copy to buddy_data do not free
347 g_free(bd.nickname); 348 g_free(bd.nickname);
348 */ 349 */
350 /*qq_request_buddy_memo(gc, ((qq_buddy_data*)buddy->proto_data)->uid, 0, QQ_BUDDY_MEMO_GET);*/
351 qq_request_buddy_memo(gc, bd.uid, bd.uid, QQ_BUDDY_MEMO_GET);
349 } 352 }
350 353
351 if(bytes > data_len) { 354 if(bytes > data_len) {
352 purple_debug_error("QQ", 355 purple_debug_error("QQ",
353 "qq_process_get_buddies: Dangerous error! maybe protocol changed, notify developers!"); 356 "qq_process_get_buddies: Dangerous error! maybe protocol changed, notify developers!");
458 } 461 }
459 return ret; 462 return ret;
460 } 463 }
461 464
462 /* send a packet to change my online status */ 465 /* send a packet to change my online status */
463 void qq_request_change_status(PurpleConnection *gc, gint update_class) 466 void qq_request_change_status(PurpleConnection *gc, guint32 update_class)
464 { 467 {
465 qq_data *qd; 468 qq_data *qd;
466 guint8 raw_data[16] = {0}; 469 guint8 raw_data[16] = {0};
467 gint bytes = 0; 470 gint bytes = 0;
468 guint8 away_cmd; 471 guint8 away_cmd;