Mercurial > pidgin
comparison libpurple/protocols/qq/buddy_list.c @ 24156:147f1b17b6ce
2008.10.08 - ccpaging <ccpaging(at)gmail.com>
* Update 'group' protocol
author | SHiNE CsyFeK <csyfek@gmail.com> |
---|---|
date | Tue, 28 Oct 2008 16:35:06 +0000 |
parents | 237e5a94e11c |
children | 1ee91ff0d5fe |
comparison
equal
deleted
inserted
replaced
24155:3c52353b83ae | 24156:147f1b17b6ce |
---|---|
250 purple_debug_error("QQ", | 250 purple_debug_error("QQ", |
251 "qq_process_get_buddies_online: Dangerous error! maybe protocol changed, notify developers!\n"); | 251 "qq_process_get_buddies_online: Dangerous error! maybe protocol changed, notify developers!\n"); |
252 } | 252 } |
253 | 253 |
254 purple_debug_info("QQ", "Received %d online buddies, nextposition=%u\n", | 254 purple_debug_info("QQ", "Received %d online buddies, nextposition=%u\n", |
255 count, (guint) position); | 255 count, (guint) position); |
256 return position; | 256 return position; |
257 } | 257 } |
258 | 258 |
259 | 259 |
260 /* process reply for get_buddies_list */ | 260 /* process reply for get_buddies_list */ |
355 gint i, j; | 355 gint i, j; |
356 gint bytes; | 356 gint bytes; |
357 guint8 sub_cmd, reply_code; | 357 guint8 sub_cmd, reply_code; |
358 guint32 unknown, position; | 358 guint32 unknown, position; |
359 guint32 uid; | 359 guint32 uid; |
360 guint8 type, groupid; | 360 guint8 type; |
361 qq_group *group; | 361 qq_group *group; |
362 | 362 |
363 g_return_val_if_fail(data != NULL && data_len != 0, -1); | 363 g_return_val_if_fail(data != NULL && data_len != 0, -1); |
364 | 364 |
365 qd = (qq_data *) gc->proto_data; | 365 qd = (qq_data *) gc->proto_data; |
381 while (bytes < data_len) { | 381 while (bytes < data_len) { |
382 /* 00-03: uid */ | 382 /* 00-03: uid */ |
383 bytes += qq_get32(&uid, data + bytes); | 383 bytes += qq_get32(&uid, data + bytes); |
384 /* 04: type 0x1:buddy 0x4:Qun */ | 384 /* 04: type 0x1:buddy 0x4:Qun */ |
385 bytes += qq_get8(&type, data + bytes); | 385 bytes += qq_get8(&type, data + bytes); |
386 /* 05: groupid*4 */ /* seems to always be 0 */ | 386 /* 05: skip unknow 0x00 */ |
387 bytes += qq_get8(&groupid, data + bytes); | 387 bytes += 1; |
388 /* | |
389 purple_debug_info("QQ", "groupid: %i\n", groupid); | |
390 groupid >>= 2; | |
391 */ | |
392 if (uid == 0 || (type != 0x1 && type != 0x4)) { | 388 if (uid == 0 || (type != 0x1 && type != 0x4)) { |
393 purple_debug_info("QQ", "Buddy entry, uid=%d, type=%d", uid, type); | 389 purple_debug_info("QQ", "Buddy entry, uid=%d, type=%d", uid, type); |
394 continue; | 390 continue; |
395 } | 391 } |
396 if(0x1 == type) { /* a buddy */ | 392 if(0x1 == type) { /* a buddy */ |