libpurple/protocols/qq/buddy_info.c

branch
openq
changeset 31393
04447b1f6403
parent 31112
9022a48eb75c
equal deleted inserted replaced
31392:93902a4213b6 31393:04447b1f6403
220 220
221 purple_notify_user_info_destroy(user_info); 221 purple_notify_user_info_destroy(user_info);
222 g_strfreev(segments); 222 g_strfreev(segments);
223 } 223 }
224 224
225 void qq_request_buddy_info(PurpleConnection *gc, guint32 uid, 225 void qq_request_buddy_info(PurpleConnection *gc, UID uid,
226 guint32 update_class, int action) 226 UPDCLS update_class, int action)
227 { 227 {
228 gchar raw_data[16] = {0}; 228 gchar raw_data[16] = {0};
229 229
230 g_return_if_fail(uid != 0); 230 g_return_if_fail(uid != 0);
231 231
619 static void update_buddy_info(PurpleConnection *gc, gchar **segments) 619 static void update_buddy_info(PurpleConnection *gc, gchar **segments)
620 { 620 {
621 PurpleBuddy *buddy = NULL; 621 PurpleBuddy *buddy = NULL;
622 qq_data *qd = NULL; 622 qq_data *qd = NULL;
623 qq_buddy_data *bd = NULL; 623 qq_buddy_data *bd = NULL;
624 guint32 uid; 624 UID uid;
625 gchar *who; 625 gchar *who;
626 gchar *alias_utf8; 626 gchar *alias_utf8;
627 627
628 PurpleAccount *account = purple_connection_get_account(gc); 628 PurpleAccount *account = purple_connection_get_account(gc);
629 qd = (qq_data *)purple_connection_get_protocol_data(gc); 629 qd = (qq_data *)purple_connection_get_protocol_data(gc);
740 break; 740 break;
741 } 741 }
742 return; 742 return;
743 } 743 }
744 744
745 void qq_request_get_level(PurpleConnection *gc, guint32 uid) 745 void qq_request_get_level(PurpleConnection *gc, UID uid)
746 { 746 {
747 qq_data *qd = (qq_data *) gc->proto_data; 747 qq_data *qd = (qq_data *) gc->proto_data;
748 guint8 buf[16] = {0}; 748 guint8 buf[16] = {0};
749 gint bytes = 0; 749 gint bytes = 0;
750 750
755 } 755 }
756 bytes += qq_put32(buf + bytes, uid); 756 bytes += qq_put32(buf + bytes, uid);
757 qq_send_cmd(gc, QQ_CMD_GET_LEVEL, buf, bytes); 757 qq_send_cmd(gc, QQ_CMD_GET_LEVEL, buf, bytes);
758 } 758 }
759 759
760 void qq_request_get_level_2007(PurpleConnection *gc, guint32 uid) 760 void qq_request_get_level_2007(PurpleConnection *gc, UID uid)
761 { 761 {
762 guint8 buf[16] = {0}; 762 guint8 buf[16] = {0};
763 gint bytes = 0; 763 gint bytes = 0;
764 764
765 bytes += qq_put8(buf + bytes, 0x08); 765 bytes += qq_put8(buf + bytes, 0x08);
766 bytes += qq_put32(buf + bytes, uid); 766 bytes += qq_put32(buf + bytes, uid);
767 bytes += qq_put8(buf + bytes, 0x00); 767 bytes += qq_put8(buf + bytes, 0x00);
768 qq_send_cmd(gc, QQ_CMD_GET_LEVEL, buf, bytes); 768 qq_send_cmd(gc, QQ_CMD_GET_LEVEL, buf, bytes);
769 } 769 }
770 770
771 void qq_request_get_buddies_level(PurpleConnection *gc, guint32 update_class) 771 void qq_request_get_buddies_level(PurpleConnection *gc, UPDCLS update_class)
772 { 772 {
773 qq_data *qd = (qq_data *) gc->proto_data; 773 qq_data *qd = (qq_data *) gc->proto_data;
774 PurpleBuddy *buddy; 774 PurpleBuddy *buddy;
775 qq_buddy_data *bd; 775 qq_buddy_data *bd;
776 guint8 *buf; 776 guint8 *buf;
796 } 796 }
797 797
798 static void process_level(PurpleConnection *gc, guint8 *data, gint data_len) 798 static void process_level(PurpleConnection *gc, guint8 *data, gint data_len)
799 { 799 {
800 gint bytes = 0; 800 gint bytes = 0;
801 guint32 uid, onlineTime; 801 UID uid;
802 guint32 onlineTime;
802 guint16 level, timeRemainder; 803 guint16 level, timeRemainder;
803 qq_buddy_data *bd; 804 qq_buddy_data *bd;
804 805
805 while (data_len - bytes >= 12) { 806 while (data_len - bytes >= 12) {
806 bytes += qq_get32(&uid, data + bytes); 807 bytes += qq_get32(&uid, data + bytes);
828 } 829 }
829 830
830 static void process_level_2007(PurpleConnection *gc, guint8 *data, gint data_len) 831 static void process_level_2007(PurpleConnection *gc, guint8 *data, gint data_len)
831 { 832 {
832 gint bytes; 833 gint bytes;
833 guint32 uid, onlineTime; 834 UID uid;
835 guint32 onlineTime;
834 guint16 level, timeRemainder; 836 guint16 level, timeRemainder;
835 qq_buddy_data *bd; 837 qq_buddy_data *bd;
836 guint16 str_len; 838 guint16 str_len;
837 gchar *str; 839 gchar *str;
838 gchar *str_utf8; 840 gchar *str_utf8;

mercurial