Mercurial > pidgin.yaz
comparison libpurple/protocols/qq/buddy_list.c @ 23053:55f986ccbb6a
patch-05-reconnect-and-code-cleanup
author | SHiNE CsyFeK <csyfek@gmail.com> |
---|---|
date | Tue, 24 Jun 2008 12:28:38 +0000 |
parents | 51dbe83ebbd3 |
children | ebad75b719f5 |
comparison
equal
deleted
inserted
replaced
23052:51dbe83ebbd3 | 23053:55f986ccbb6a |
---|---|
79 /* 002-002 */ | 79 /* 002-002 */ |
80 bytes += qq_put8(raw_data + bytes, 0x00); | 80 bytes += qq_put8(raw_data + bytes, 0x00); |
81 /* 003-004 */ | 81 /* 003-004 */ |
82 bytes += qq_put16(raw_data + bytes, 0x0000); | 82 bytes += qq_put16(raw_data + bytes, 0x0000); |
83 | 83 |
84 qq_send_cmd(gc, QQ_CMD_GET_FRIENDS_ONLINE, TRUE, 0, TRUE, raw_data, 5); | 84 qq_send_cmd(qd, QQ_CMD_GET_FRIENDS_ONLINE, raw_data, 5); |
85 qd->last_get_online = time(NULL); | 85 qd->last_get_online = time(NULL); |
86 } | 86 } |
87 | 87 |
88 /* position starts with 0x0000, | 88 /* position starts with 0x0000, |
89 * server may return a position tag if list is too long for one packet */ | 89 * server may return a position tag if list is too long for one packet */ |
90 void qq_send_packet_get_buddies_list(PurpleConnection *gc, guint16 position) | 90 void qq_send_packet_get_buddies_list(PurpleConnection *gc, guint16 position) |
91 { | 91 { |
92 qq_data *qd = (qq_data *) gc->proto_data; | |
92 guint8 raw_data[16] = {0}; | 93 guint8 raw_data[16] = {0}; |
93 gint bytes = 0; | 94 gint bytes = 0; |
94 | 95 |
95 /* 000-001 starting position, can manually specify */ | 96 /* 000-001 starting position, can manually specify */ |
96 bytes += qq_put16(raw_data + bytes, position); | 97 bytes += qq_put16(raw_data + bytes, position); |
99 * even can sending packets 00 and get no response. | 100 * even can sending packets 00 and get no response. |
100 * Now I tested that 00,00,00,00,00,01 work perfectly | 101 * Now I tested that 00,00,00,00,00,01 work perfectly |
101 * March 22, found the 00,00,00 starts to work as well */ | 102 * March 22, found the 00,00,00 starts to work as well */ |
102 bytes += qq_put8(raw_data + bytes, 0x00); | 103 bytes += qq_put8(raw_data + bytes, 0x00); |
103 | 104 |
104 qq_send_cmd(gc, QQ_CMD_GET_FRIENDS_LIST, TRUE, 0, TRUE, raw_data, bytes); | 105 qq_send_cmd(qd, QQ_CMD_GET_FRIENDS_LIST, raw_data, bytes); |
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_send_packet_get_all_list_with_group(PurpleConnection *gc, guint32 position) | 109 void qq_send_packet_get_all_list_with_group(PurpleConnection *gc, guint32 position) |
109 { | 110 { |
111 qq_data *qd = (qq_data *) gc->proto_data; | |
110 guint8 raw_data[16] = {0}; | 112 guint8 raw_data[16] = {0}; |
111 gint bytes = 0; | 113 gint bytes = 0; |
112 | 114 |
113 /* 0x01 download, 0x02, upload */ | 115 /* 0x01 download, 0x02, upload */ |
114 bytes += qq_put8(raw_data + bytes, 0x01); | 116 bytes += qq_put8(raw_data + bytes, 0x01); |
116 bytes += qq_put8(raw_data + bytes, 0x02); | 118 bytes += qq_put8(raw_data + bytes, 0x02); |
117 /* unknown 00 00 00 00 */ | 119 /* unknown 00 00 00 00 */ |
118 bytes += qq_put32(raw_data + bytes, 0x00000000); | 120 bytes += qq_put32(raw_data + bytes, 0x00000000); |
119 bytes += qq_put32(raw_data + bytes, position); | 121 bytes += qq_put32(raw_data + bytes, position); |
120 | 122 |
121 qq_send_cmd(gc, QQ_CMD_GET_ALL_LIST_WITH_GROUP, TRUE, 0, TRUE, raw_data, bytes); | 123 qq_send_cmd(qd, QQ_CMD_GET_ALL_LIST_WITH_GROUP, raw_data, bytes); |
122 } | 124 } |
123 | 125 |
124 static void _qq_buddies_online_reply_dump_unclear(qq_friends_online_entry *fe) | 126 static void _qq_buddies_online_reply_dump_unclear(qq_friends_online_entry *fe) |
125 { | 127 { |
126 GString *dump; | 128 GString *dump; |