pidgin.openq: 24a25744: 2008.10.08 - ccpaging <ccpaging(at)gmail...

csyfek at gmail.com csyfek at gmail.com
Tue Oct 28 12:55:40 EDT 2008


-----------------------------------------------------------------
Revision: 24a25744d34d0648854a70f7729112401fdd62f9
Ancestor: fca4b0acba790679dc9ae2571a99d0ecb4467e0a
Author: csyfek at gmail.com
Date: 2008-10-28T16:29:42
Branch: im.pidgin.pidgin.openq
URL: http://d.pidgin.im/viewmtn/revision/info/24a25744d34d0648854a70f7729112401fdd62f9

Modified files:
        libpurple/protocols/qq/ChangeLog
        libpurple/protocols/qq/buddy_info.c
        libpurple/protocols/qq/buddy_info.h
        libpurple/protocols/qq/group.c
        libpurple/protocols/qq/group.h
        libpurple/protocols/qq/group_free.c
        libpurple/protocols/qq/group_im.c
        libpurple/protocols/qq/group_info.c
        libpurple/protocols/qq/group_internal.c
        libpurple/protocols/qq/group_internal.h
        libpurple/protocols/qq/group_join.c
        libpurple/protocols/qq/group_join.h
        libpurple/protocols/qq/qq.c
        libpurple/protocols/qq/qq_process.c

ChangeLog: 

2008.10.08 - ccpaging <ccpaging(at)gmail.com>
	* 20081008-1

-------------- next part --------------
============================================================
--- libpurple/protocols/qq/ChangeLog	74e4ba9da2c6c2d0d6ddbe59c8fd7c12d28def7a
+++ libpurple/protocols/qq/ChangeLog	13e7b6647ac18c88fbcc4c44a037a37ecf812c3c
@@ -1,4 +1,7 @@ 2008.10.08 - ccpaging <ccpaging(at)gmail
 2008.10.08 - ccpaging <ccpaging(at)gmail.com>
+	* 20081008-1
+
+2008.10.08 - ccpaging <ccpaging(at)gmail.com>
 	* Update group part
 	* Delete some meaningless functions and data
 	* Added 'change my icon'
============================================================
--- libpurple/protocols/qq/buddy_info.c	3e2287d076b7dc145c53d85b368dec01f7fa0e38
+++ libpurple/protocols/qq/buddy_info.c	924237fad068f3e64aab3b8590934b3b3316c876
@@ -232,7 +232,7 @@ void qq_request_buddy_info(PurpleConnect
 }
 
 /* send packet to modify personal information */
-static void request_modify_info(PurpleConnection *gc, gchar **segments)
+static void request_change_info(PurpleConnection *gc, gchar **segments)
 {
 	gint bytes = 0;
 	guint8 raw_data[MAX_PACKET_SIZE - 128] = {0};
@@ -323,7 +323,7 @@ static void info_modify_ok_cb(modify_inf
 				break;
 		}
 	}
-	request_modify_info(gc, segments);
+	request_change_info(gc, segments);
 
 	g_strfreev(segments);
 	g_free(info_request);
@@ -445,16 +445,15 @@ static void info_modify_dialogue(PurpleC
 }
 
 /* process the reply of modify_info packet */
-void qq_process_modify_info_reply(guint8 *data, gint data_len, PurpleConnection *gc)
+void qq_process_change_info(PurpleConnection *gc, guint8 *data, gint data_len)
 {
 	qq_data *qd;
-
 	g_return_if_fail(data != NULL && data_len != 0);
 
 	qd = (qq_data *) gc->proto_data;
 
 	data[data_len] = '\0';
-	if (qd->uid == atoi((gchar *) data)) {	/* return should be my uid */
+	if (qd->uid != atoi((gchar *) data)) {	/* return should be my uid */
 		purple_debug_info("QQ", "Update info ACK OK\n");
 		qq_got_attention(gc, _("Successed changing buddy information."));
 	}
@@ -486,6 +485,7 @@ void qq_change_icon_cb(PurpleConnection 
 	const gchar *filename;
 	gint index;
 	gint face;
+	gchar *error;
 
 	g_return_if_fail(filepath != NULL);
 
@@ -507,7 +507,9 @@ void qq_change_icon_cb(PurpleConnection 
 	filename = segments[index];
 	index = strcspn (filename, "0123456789");
 	if (index < 0 || index >= strlen(filename)) {
-		purple_debug_info("QQ", "No digital in %s\n", filename);
+		error = g_strdup_printf(_("Can not get face number in file name (%s)"), filename);
+		purple_notify_error(gc, _("QQ Buddy"), _("Failed change icon"), error);
+		g_free(error);
 		return;
 	}
 	face = strtol(filename+index, NULL, 10);
@@ -542,16 +544,15 @@ gchar *qq_get_icon_name(gint face)
 
 gchar *qq_get_icon_name(gint face)
 {
-	gchar *num_str, *icon_name;
+	gint icon;
+	gchar *icon_name;
 
+	icon = face / 3 + 1;
 	if (face < 1 || face > QQ_FACES) {
-		num_str = g_strdup_printf("%d", 1);
-	} else {
-		num_str = g_strdup_printf("%d", face / 3 + 1);
+		icon = 1;
 	}
-	icon_name = g_strconcat(QQ_ICON_PREFIX, num_str, QQ_ICON_SUFFIX, NULL);
-	g_free(num_str);
-
+	
+	icon_name = g_strdup_printf("%s%d%s", QQ_ICON_PREFIX, icon, QQ_ICON_SUFFIX);
 	return icon_name;
 }
 
@@ -575,7 +576,7 @@ gchar *qq_get_icon_path(gchar *icon_name
 			icon_dir = QQ_BUDDY_ICON_DIR;
 #endif
 	}
-	icon_path = g_strconcat(icon_dir, G_DIR_SEPARATOR_S, icon_name, NULL);
+	icon_path = g_strdup_printf("%s%c%s", icon_dir, G_DIR_SEPARATOR, icon_name);
 
 	return icon_path;
 }
@@ -594,7 +595,9 @@ static void update_buddy_icon(PurpleAcco
 	icon_name = qq_get_icon_name(face);
 	if ((buddy = purple_find_buddy(account, who))) {
 		icon_name_prev = purple_buddy_icons_get_checksum_for_user(buddy);
-		purple_debug_info("QQ", "Previous icon is %s\n", icon_name_prev);
+		if (icon_name_prev != NULL) {
+			purple_debug_info("QQ", "Previous icon is %s\n", icon_name_prev);
+		}
 	}
 	if (icon_name_prev != NULL && !strcmp(icon_name, icon_name_prev)) {
 		purple_debug_info("QQ", "Icon is not changed\n");
@@ -700,13 +703,15 @@ void qq_process_get_buddy_info(guint8 *d
 #endif
 
 	if (action == QQ_BUDDY_INFO_SET_ICON) {
-		/* send new face to server */
 		if (strtol(segments[QQ_INFO_FACE], NULL, 10) != qd->my_icon) {
 			icon_name = g_strdup_printf("%d", qd->my_icon);
 			g_free(segments[QQ_INFO_FACE]);
 			segments[QQ_INFO_FACE] = icon_name;
 
-			request_modify_info(gc, segments);
+			/* Update me in buddy list */
+			update_buddy_info(gc, segments);
+			/* send new face to server */
+			request_change_info(gc, segments);
 		}
 		g_strfreev(segments);
 		return;
============================================================
--- libpurple/protocols/qq/buddy_info.h	9d6f2286c401a7123cacf4959bfde9dc9945481b
+++ libpurple/protocols/qq/buddy_info.h	4fee2fe687e6d78d4a66748a559c85badd369e3d
@@ -81,7 +81,7 @@ void qq_set_custom_icon(PurpleConnection
 void qq_request_buddy_info(PurpleConnection *gc, guint32 uid,
 		gint update_class, int action);
 void qq_set_custom_icon(PurpleConnection *gc, PurpleStoredImage *img);
-void qq_process_modify_info_reply(guint8 *data, gint data_len, PurpleConnection *gc);
+void qq_process_change_info(PurpleConnection *gc, guint8 *data, gint data_len);
 void qq_process_get_buddy_info(guint8 *data, gint data_len, guint32 action, PurpleConnection *gc);
 
 void qq_request_get_level(PurpleConnection *gc, guint32 uid);
============================================================
--- libpurple/protocols/qq/group.c	c702648724fc23ffb600c252770d9effdff06128
+++ libpurple/protocols/qq/group.c	ae31aa68f560579659162480b64be92b29ac9398
@@ -98,20 +98,8 @@ PurpleRoomlist *qq_roomlist_get_list(Pur
 
 	f = purple_roomlist_field_new(PURPLE_ROOMLIST_FIELD_STRING, _("Group ID"), QQ_ROOM_KEY_EXTERNAL_ID, FALSE);
 	fields = g_list_append(fields, f);
-	f = purple_roomlist_field_new(PURPLE_ROOMLIST_FIELD_STRING, _("Creator"), QQ_ROOM_KEY_CREATOR_UID, FALSE);
-	fields = g_list_append(fields, f);
-	f = purple_roomlist_field_new(PURPLE_ROOMLIST_FIELD_STRING,
-				    _("Group Description"), QQ_ROOM_KEY_DESC_UTF8, FALSE);
-	fields = g_list_append(fields, f);
 	f = purple_roomlist_field_new(PURPLE_ROOMLIST_FIELD_STRING, "", QQ_ROOM_KEY_INTERNAL_ID, TRUE);
 	fields = g_list_append(fields, f);
-	f = purple_roomlist_field_new(PURPLE_ROOMLIST_FIELD_STRING, "", QQ_ROOM_KEY_TYPE, TRUE);
-	fields = g_list_append(fields, f);
-	f = purple_roomlist_field_new(PURPLE_ROOMLIST_FIELD_STRING, _("Auth"), QQ_ROOM_KEY_AUTH_TYPE, TRUE);
-	fields = g_list_append(fields, f);
-	f = purple_roomlist_field_new(PURPLE_ROOMLIST_FIELD_STRING, "", QQ_ROOM_KEY_CATEGORY, TRUE);
-	fields = g_list_append(fields, f);
-	f = purple_roomlist_field_new(PURPLE_ROOMLIST_FIELD_STRING, "", QQ_ROOM_KEY_TITLE_UTF8, TRUE);
 
 	fields = g_list_append(fields, f);
 	purple_roomlist_set_fields(rl, fields);
============================================================
--- libpurple/protocols/qq/group.h	f1ec75748935a87e0fd32453eb60025fef6a9979
+++ libpurple/protocols/qq/group.h	04b3c9fdfe214a2eac3f47e0663947ee2cce34ed
@@ -43,7 +43,6 @@ typedef struct _qq_group {
 typedef struct _qq_group {
 	/* all these will be saved when we exit Purple */
 	qq_room_role my_role;	/* my role for this room */
-	gchar *my_role_desc;			/* my role description */
 	guint32 id;
 	guint32 ext_id;
 	guint8 type8;			/* permanent or temporory */
============================================================
--- libpurple/protocols/qq/group_free.c	4a8cf888cc6b711a627381a9427ebcb5d472c738
+++ libpurple/protocols/qq/group_free.c	77e4beef0cb24cc704a0820963d67884d08960f0
@@ -53,7 +53,6 @@ void qq_group_free(qq_group *group)
 {
 	g_return_if_fail(group != NULL);
 	qq_group_free_member(group);
-	g_free(group->my_role_desc);
 	g_free(group->title_utf8);
 	g_free(group->desc_utf8);
 	g_free(group->notice_utf8);
============================================================
--- libpurple/protocols/qq/group_im.c	c6b3beba85231123556853cee30dbbfbabd7b230
+++ libpurple/protocols/qq/group_im.c	7eb3b8ee8216fdb987dca3f8f0de620b41709998
@@ -457,7 +457,7 @@ void qq_process_room_msg_normal(guint8 *
 
 	qd = (qq_data *) gc->proto_data;
 
-#if 0
+#if 1
 	qq_hex_dump(PURPLE_DEBUG_INFO, "QQ", data, data_len, "group im hex dump");
 #endif
 	memset(&packet, 0, sizeof(packet));
============================================================
--- libpurple/protocols/qq/group_info.c	df124f3160d12b73a5eb131532bb108f1d2a44a0
+++ libpurple/protocols/qq/group_info.c	3f6d2d797116e49d1e9fa78f6d0a9246033e39ed
@@ -102,6 +102,29 @@ gint qq_request_room_get_buddies(PurpleC
 	return num;
 }
 
+static gchar *get_role_desc(qq_room_role role)
+{
+	const char *role_desc;
+	switch (role) {
+	case QQ_ROOM_ROLE_NO:
+		role_desc = _("Not member");
+		break;
+	case QQ_ROOM_ROLE_YES:
+		role_desc = _("Member");
+		break;
+	case QQ_ROOM_ROLE_REQUESTING:
+		role_desc = _("Requesting");
+		break;
+	case QQ_ROOM_ROLE_ADMIN:
+		role_desc = _("Admin");
+		break;
+	default:
+		role_desc = _("Unknown");
+	}
+
+	return g_strdup(role_desc);
+}
+
 static void room_info_display(PurpleConnection *gc, qq_group *group)
 {
 	PurpleNotifyUserInfo *room_info;
@@ -121,7 +144,9 @@ static void room_info_display(PurpleConn
 	purple_notify_user_info_add_pair(room_info, _("Creator"), utf8_value);
 	g_free(utf8_value);
 
-	purple_notify_user_info_add_pair(room_info, _("About me"), group->my_role_desc);
+	utf8_value = get_role_desc(group->my_role);
+	purple_notify_user_info_add_pair(room_info, _("About me"), utf8_value);
+	g_free(utf8_value);
 
 	utf8_value = g_strdup_printf(("%d"), group->category);
 	purple_notify_user_info_add_pair(room_info, _("Category"), utf8_value);
============================================================
--- libpurple/protocols/qq/group_internal.c	9da0fc05895ebae32db5e9cadea5aae42a2b7cdc
+++ libpurple/protocols/qq/group_internal.c	cb893633d1550943da1932c27425014b4f20d4c7
@@ -31,31 +31,6 @@
 #include "group_internal.h"
 #include "utils.h"
 
-static gchar *get_role_desc(qq_group *group)
-{
-	const char *role_desc;
-	g_return_val_if_fail(group != NULL, g_strdup(""));
-
-	switch (group->my_role) {
-	case QQ_ROOM_ROLE_NO:
-		role_desc = _("Not member");
-		break;
-	case QQ_ROOM_ROLE_YES:
-		role_desc = _("Member");
-		break;
-	case QQ_ROOM_ROLE_REQUESTING:
-		role_desc = _("Requesting");
-		break;
-	case QQ_ROOM_ROLE_ADMIN:
-		role_desc = _("Admin");
-		break;
-	default:
-		role_desc = _("Unknown");
-	}
-
-	return g_strdup(role_desc);
-}
-
 static void add_room_to_blist(PurpleConnection *gc, qq_group *group)
 {
 	GHashTable *components;
@@ -83,7 +58,6 @@ qq_group *qq_group_create_internal_recor
 
         group = g_new0(qq_group, 1);
         group->my_role = QQ_ROOM_ROLE_NO;
-        group->my_role_desc = get_role_desc(group);
         group->id = internal_id;
         group->ext_id = ext_id;
         group->type8 = 0x01;       /* assume permanent Qun */
@@ -124,21 +98,12 @@ GHashTable *qq_group_to_hashtable(qq_gro
 {
 	GHashTable *components;
 	components = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
-	g_hash_table_insert(components, g_strdup(QQ_ROOM_KEY_ROLE), g_strdup_printf("%d", group->my_role));
-	group->my_role_desc = get_role_desc(group);
 
 	g_hash_table_insert(components,
 			    g_strdup(QQ_ROOM_KEY_INTERNAL_ID), g_strdup_printf("%d", group->id));
 	g_hash_table_insert(components, g_strdup(QQ_ROOM_KEY_EXTERNAL_ID),
 			    g_strdup_printf("%d", group->ext_id));
-	g_hash_table_insert(components, g_strdup(QQ_ROOM_KEY_TYPE), g_strdup_printf("%d", group->type8));
-	g_hash_table_insert(components, g_strdup(QQ_ROOM_KEY_CREATOR_UID), g_strdup_printf("%d", group->creator_uid));
-	g_hash_table_insert(components,
-			    g_strdup(QQ_ROOM_KEY_CATEGORY), g_strdup_printf("%d", group->category));
-	g_hash_table_insert(components, g_strdup(QQ_ROOM_KEY_AUTH_TYPE), g_strdup_printf("%d", group->auth_type));
-	g_hash_table_insert(components, g_strdup(QQ_ROOM_KEY_ROLE_DESC), g_strdup(group->my_role_desc));
 	g_hash_table_insert(components, g_strdup(QQ_ROOM_KEY_TITLE_UTF8), g_strdup(group->title_utf8));
-	g_hash_table_insert(components, g_strdup(QQ_ROOM_KEY_DESC_UTF8), g_strdup(group->desc_utf8));
 	return components;
 }
 
@@ -158,22 +123,18 @@ qq_group *qq_room_data_new_by_hashtable(
 	qd = (qq_data *) gc->proto_data;
 
 	group = g_new0(qq_group, 1);
-	group->my_role =
-	    str2dec
-	    (NULL ==
-	     g_hash_table_lookup(data,
-				 QQ_ROOM_KEY_ROLE) ?
-	     g_strdup_printf("%d", QQ_ROOM_ROLE_NO) :
-	     g_hash_table_lookup(data, QQ_ROOM_KEY_ROLE));
+	memset(group, 0, sizeof(qq_group));
+	group->my_role = QQ_ROOM_ROLE_YES;
 	group->id = str2dec(g_hash_table_lookup(data, QQ_ROOM_KEY_INTERNAL_ID));
 	group->ext_id = str2dec(g_hash_table_lookup(data, QQ_ROOM_KEY_EXTERNAL_ID));
-	group->type8 = str2dec(g_hash_table_lookup(data, QQ_ROOM_KEY_TYPE));
-	group->creator_uid = str2dec(g_hash_table_lookup(data, QQ_ROOM_KEY_CREATOR_UID));
-	group->category = str2dec(g_hash_table_lookup(data, QQ_ROOM_KEY_CATEGORY));
-	group->auth_type = str2dec(g_hash_table_lookup(data, QQ_ROOM_KEY_AUTH_TYPE));
 	group->title_utf8 = g_strdup(g_hash_table_lookup(data, QQ_ROOM_KEY_TITLE_UTF8));
-	group->desc_utf8 = g_strdup(g_hash_table_lookup(data, QQ_ROOM_KEY_DESC_UTF8));
-	group->my_role_desc = get_role_desc(group);
+    group->type8 = 0x01;       /* assume permanent Qun */
+    group->creator_uid = 10000;     /* assume by QQ admin */
+    group->category = 0x01;
+    group->auth_type = 0x02;        /* assume need auth */
+    group->desc_utf8 = g_strdup("");
+    group->notice_utf8 = g_strdup("");
+    group->members = NULL;
 	group->is_got_buddies = FALSE;
 
 	purple_debug_info("QQ", "Created room info from hashtable: %s, %d, id %d\n",
@@ -206,27 +167,11 @@ void qq_group_refresh(PurpleConnection *
 	if (group->title_utf8 != NULL && strlen(group->title_utf8) > 0)
 		purple_blist_alias_chat(chat, group->title_utf8);
 	g_hash_table_replace(chat->components,
-		     g_strdup(QQ_ROOM_KEY_ROLE), g_strdup_printf("%d", group->my_role));
-	group->my_role_desc = get_role_desc(group);
-	g_hash_table_replace(chat->components,
-		     g_strdup(QQ_ROOM_KEY_ROLE_DESC), g_strdup(group->my_role_desc));
-	g_hash_table_replace(chat->components,
 		     g_strdup(QQ_ROOM_KEY_INTERNAL_ID),
 		     g_strdup_printf("%d", group->id));
 	g_hash_table_replace(chat->components,
 		     g_strdup(QQ_ROOM_KEY_EXTERNAL_ID),
 		     g_strdup_printf("%d", group->ext_id));
 	g_hash_table_replace(chat->components,
-		     g_strdup(QQ_ROOM_KEY_TYPE), g_strdup_printf("%d", group->type8));
-	g_hash_table_replace(chat->components,
-		     g_strdup(QQ_ROOM_KEY_CREATOR_UID), g_strdup_printf("%d", group->creator_uid));
-	g_hash_table_replace(chat->components,
-		     g_strdup(QQ_ROOM_KEY_CATEGORY),
-		     g_strdup_printf("%d", group->category));
-	g_hash_table_replace(chat->components,
-		     g_strdup(QQ_ROOM_KEY_AUTH_TYPE), g_strdup_printf("%d", group->auth_type));
-	g_hash_table_replace(chat->components,
 		     g_strdup(QQ_ROOM_KEY_TITLE_UTF8), g_strdup(group->title_utf8));
-	g_hash_table_replace(chat->components,
-		     g_strdup(QQ_ROOM_KEY_DESC_UTF8), g_strdup(group->desc_utf8));
 }
============================================================
--- libpurple/protocols/qq/group_internal.h	5382e523ee867ccdd15e2cc3af2e690bf7403d98
+++ libpurple/protocols/qq/group_internal.h	97ed82b122bb427cc12c99e225b8e65de775079b
@@ -28,16 +28,9 @@
 #include <glib.h>
 #include "group.h"
 
-#define QQ_ROOM_KEY_ROLE									"my_role"
-#define QQ_ROOM_KEY_ROLE_DESC						"my_role_desc"
 #define QQ_ROOM_KEY_INTERNAL_ID					"id"
 #define QQ_ROOM_KEY_EXTERNAL_ID					"ext_id"
-#define QQ_ROOM_KEY_TYPE									"type"
-#define QQ_ROOM_KEY_CREATOR_UID					"creator_uid"
-#define QQ_ROOM_KEY_CATEGORY							"category"
-#define QQ_ROOM_KEY_AUTH_TYPE						"auth_type"
-#define QQ_ROOM_KEY_TITLE_UTF8						"title_utf8"
-#define QQ_ROOM_KEY_DESC_UTF8						"desc_utf8"
+#define QQ_ROOM_KEY_TITLE_UTF8					"title_utf8"
 
 qq_group *qq_group_create_internal_record(PurpleConnection *gc,
 		guint32 internal_id, guint32 ext_id, gchar *group_name_utf8);
============================================================
--- libpurple/protocols/qq/group_join.c	338cf608818fe1dba1b5e35060a69fe6f581ba62
+++ libpurple/protocols/qq/group_join.c	0ea4ef16afe1dec9f1d1473466d4778f4b334ef2
@@ -345,22 +345,13 @@ void qq_group_join(PurpleConnection *gc,
 	qq_request_room_search(gc, ext_id, QQ_ROOM_SEARCH_FOR_JOIN);
 }
 
-void qq_room_quit(PurpleConnection *gc, GHashTable *data)
+void qq_room_quit(PurpleConnection *gc, guint32 room_id)
 {
-	gchar *id_ptr;
-	guint32 id;
 	qq_add_request *add_req;
 
-	g_return_if_fail(data != NULL);
-
-	id_ptr = g_hash_table_lookup(data, QQ_ROOM_KEY_INTERNAL_ID);
-	id = strtol(id_ptr, NULL, 10);
-
-	g_return_if_fail(id > 0);
-
 	add_req = g_new0(qq_add_request, 1);
 	add_req->gc = gc;
-	add_req->uid = id;
+	add_req->uid = room_id;
 
 	purple_request_action(gc, _("QQ Qun Operation"),
 			    _("Quit Qun"),
============================================================
--- libpurple/protocols/qq/group_join.h	484a35954c04266abee1f7f8d28a4758eb6af6db
+++ libpurple/protocols/qq/group_join.h	d62ecf529569c417090801dcdb0ed53b90bfdce0
@@ -44,7 +44,7 @@ void qq_request_room_join(PurpleConnecti
 void qq_send_cmd_group_auth(PurpleConnection *gc, qq_group *group, guint8 opt, guint32 uid, const gchar *reason_utf8);
 void qq_group_join(PurpleConnection *gc, GHashTable *data);
 void qq_request_room_join(PurpleConnection *gc, qq_group *group);
-void qq_room_quit(PurpleConnection *gc, GHashTable *data);
+void qq_room_quit(PurpleConnection *gc, guint32 room_id);
 void qq_process_group_cmd_exit_group(guint8 *data, gint len, PurpleConnection *gc);
 void qq_process_group_cmd_join_group_auth(guint8 *data, gint len, PurpleConnection *gc);
 void qq_process_group_cmd_join_group(guint8 *data, gint len, PurpleConnection *gc);
============================================================
--- libpurple/protocols/qq/qq.c	1dd26406c4ab564e48c4fd9daeb88dc851339e80
+++ libpurple/protocols/qq/qq.c	139874e3355c73e9e65ce7c1989553b3defabf5d
@@ -746,11 +746,18 @@ static void action_chat_quit(PurpleBlist
 	PurpleChat *chat = (PurpleChat *)node;
 	PurpleConnection *gc = purple_account_get_connection(chat->account);
 	GHashTable *components = chat -> components;
+	gchar *num_str;
+	guint32 room_id;
 
 	g_return_if_fail(PURPLE_BLIST_NODE_IS_CHAT(node));
 
 	g_return_if_fail(components != NULL);
-	qq_room_quit(gc, components);
+
+	num_str = g_hash_table_lookup(components, QQ_ROOM_KEY_INTERNAL_ID);
+	room_id = strtol(num_str, NULL, 10);
+	g_return_if_fail(room_id != 0);
+
+	qq_room_quit(gc, room_id);
 }
 
 static void action_chat_get_info(PurpleBlistNode * node)
@@ -758,24 +765,18 @@ static void action_chat_get_info(PurpleB
 	PurpleChat *chat = (PurpleChat *)node;
 	PurpleConnection *gc = purple_account_get_connection(chat->account);
 	GHashTable *components = chat -> components;
-	gchar *uid_str;
-	guint32 uid;
-	qq_group *group;
+	gchar *num_str;
+	guint32 room_id;
 
 	g_return_if_fail(PURPLE_BLIST_NODE_IS_CHAT(node));
 
 	g_return_if_fail(components != NULL);
 
-	uid_str = g_hash_table_lookup(components, QQ_ROOM_KEY_INTERNAL_ID);
-	uid = strtol(uid_str, NULL, 10);
+	num_str = g_hash_table_lookup(components, QQ_ROOM_KEY_INTERNAL_ID);
+	room_id = strtol(num_str, NULL, 10);
+	g_return_if_fail(room_id != 0);
 
-	group = qq_room_search_id(gc, uid);
-	if (group == NULL) {
-		return;
-	}
-	g_return_if_fail(group->id > 0);
-
-	qq_send_room_cmd_mess(gc, QQ_ROOM_CMD_GET_INFO, group->id, NULL, 0,
+	qq_send_room_cmd_mess(gc, QQ_ROOM_CMD_GET_INFO, room_id, NULL, 0,
 			QQ_CMD_CLASS_UPDATE_ROOM, QQ_ROOM_INFO_DISPLAY);
 }
 
============================================================
--- libpurple/protocols/qq/qq_process.c	342441bdfb81be55a3528d8d3dfe510d2b74af36
+++ libpurple/protocols/qq/qq_process.c	95b0c1569168d0db3d1f1126b225abaa21096c55
@@ -1023,7 +1023,7 @@ void qq_proc_client_cmds(PurpleConnectio
 
 	switch (cmd) {
 		case QQ_CMD_UPDATE_INFO:
-			qq_process_modify_info_reply(data, data_len, gc);
+			qq_process_change_info(gc, data, data_len);
 			break;
 		case QQ_CMD_BUDDY_ADD_NO_AUTH:
 			qq_process_buddy_add_no_auth(data, data_len, ship32, gc);


More information about the Commits mailing list