pidgin, im.pidgin.pidgin.openq: 8433c0d5: 2009.04.23 - flos <lonicerae(at)gmail.co...
csyfek at gmail.com
csyfek at gmail.com
Thu Apr 23 11:16:00 EDT 2009
-----------------------------------------------------------------
Revision: 8433c0d5142912b0fa71f0f457a3ab7134945e87
Ancestor: 197be95e924af577788e8842130520f5fbead667
Author: csyfek at gmail.com
Date: 2009-04-23T15:20:23
Branch: im.pidgin.pidgin
Branch: im.pidgin.pidgin.openq
URL: http://d.pidgin.im/viewmtn/revision/info/8433c0d5142912b0fa71f0f457a3ab7134945e87
Modified files:
libpurple/protocols/qq/ChangeLog
libpurple/protocols/qq/buddy_info.c
ChangeLog:
2009.04.23 - flos <lonicerae(at)gmail.com>
* Fixed a bug of updating buddy who is not in user's buddy list
-------------- next part --------------
============================================================
--- libpurple/protocols/qq/ChangeLog ddc3cca6bed6057f32b792c38d196d2ae081c301
+++ libpurple/protocols/qq/ChangeLog 18bf33f0cc37a01a902116d1c8ea2827e490b3a7
@@ -1,3 +1,6 @@
+2009.04.23 - flos <lonicerae(at)gmail.com>
+ * Fixed a bug of updating buddy who is not in user's buddy list
+
2009.02.25 - flos <lonicerae(at)gmail.com>
* Changed text 'ZipCode' to 'Postal Code'
============================================================
--- libpurple/protocols/qq/buddy_info.c fa5c553660e49072670cce82046748ec40b060ff
+++ libpurple/protocols/qq/buddy_info.c 997ca090088d2790f7dcc9a16829b1961ee3bb82
@@ -606,21 +606,21 @@ static void update_buddy_info(PurpleConn
/* after getting info or modify myself, refresh the buddy list accordingly */
static void update_buddy_info(PurpleConnection *gc, gchar **segments)
{
- PurpleBuddy *buddy;
- qq_data *qd;
- qq_buddy_data *bd;
+ PurpleBuddy *buddy = NULL;
+ qq_data *qd = NULL;
+ qq_buddy_data *bd = NULL;
guint32 uid;
gchar *who;
gchar *alias_utf8;
+
PurpleAccount *account = purple_connection_get_account(gc);
-
qd = (qq_data *)purple_connection_get_protocol_data(gc);
uid = strtoul(segments[QQ_INFO_UID], NULL, 10);
who = uid_to_purple_name(uid);
-
qq_filter_str(segments[QQ_INFO_NICK]);
alias_utf8 = qq_to_utf8(segments[QQ_INFO_NICK], QQ_CHARSET_DEFAULT);
+
if (uid == qd->uid) { /* it is me */
purple_debug_info("QQ", "Got my info\n");
qd->my_icon = strtol(segments[QQ_INFO_FACE], NULL, 10);
@@ -631,12 +631,14 @@ static void update_buddy_info(PurpleConn
buddy = qq_buddy_find_or_new(gc, uid);
} else {
buddy = purple_find_buddy(gc->account, who);
+ /* purple_debug_info("QQ", "buddy=%p\n", (void*)buddy); */
}
/* if the buddy is null, the api will catch it and return null here */
bd = purple_buddy_get_protocol_data(buddy);
+ /* purple_debug_info("QQ", "bd=%p\n", (void*)bd); */
- if (buddy == NULL || bd) {
+ if (bd == NULL || buddy == NULL) {
g_free(who);
g_free(alias_utf8);
return;
@@ -646,6 +648,7 @@ static void update_buddy_info(PurpleConn
bd->age = strtol(segments[QQ_INFO_AGE], NULL, 10);
bd->gender = strtol(segments[QQ_INFO_GENDER], NULL, 10);
bd->face = strtol(segments[QQ_INFO_FACE], NULL, 10);
+
if (alias_utf8 != NULL) {
if (bd->nickname) g_free(bd->nickname);
bd->nickname = g_strdup(alias_utf8);
More information about the Commits
mailing list