changeset 27861:4af92af950cd

propagate from branch 'im.pidgin.pidgin' (head 3d0b19df4a52ab42b61494afac9c85d170398fa8) to branch 'im.pidgin.pidgin.yaz' (head 058eb8b618908d4f180790ad845bc9cfef7f7b90)
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Thu, 03 Jul 2008 13:49:24 +0000
parents 28a7992d37b2 (current diff) 1ca49b349037 (diff)
children 382e7565e628
files configure.ac libpurple/protocols/oscar/oscar.h pidgin/gtkimhtml.c
diffstat 20 files changed, 248 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Jul 02 16:07:07 2008 +0000
+++ b/ChangeLog	Thu Jul 03 13:49:24 2008 +0000
@@ -16,7 +16,7 @@
 	* Resize large incoming custom smileys to a maximum of 96px on either
 	  side.
 	* Offer to add new buddies into the same contact as existing buddies
-          in the same group if the alias given is the same.
+	  in the same group if the alias given is the same.
 
 	General:
 	* Group and Chat buddy list entries can now be given custom buddy
@@ -28,12 +28,25 @@
 	  logs.
 	* Added '/msgcolor' command to change colors of different classes of
 	  messages in a conversation. See '/help msgcolor' for details.
+	* Added tab-completion for commands in conversation windows.
 
-version 2.4.3 (??/??/2008):
+version 2.4.3 (07/01/2008):
 	libpurple:
 	* Yahoo! Japan now uses UTF-8, matching the behavior of official clients
 	  and restoring compatibility with the web messenger (Yusuke Odate)
 	* Setting your buddy icon once again works for Yahoo! accounts.
+	* Fixes in the Yahoo! protocol to prevent a double free, crashes on
+	  aliases, and alias functionality
+	* Fix crashes in the bonjour protocol
+	* Always use UTF-8 for Yahoo! (#5973)
+	* Fix a crash when the given jabber id is invalid.
+	* Make the IRC "unknown message" debugging messages UTF-8 safe.
+	* Fix connecting to ICQ
+	* Fix a memleak when handling jabber xforms.
+
+	Pidgin:
+	* Include the send button plugin in the win32 build
+	* Various memory leak fixes
 
 version 2.4.2 (05/17/2008):
 	libpurple:
--- a/ChangeLog.API	Wed Jul 02 16:07:07 2008 +0000
+++ b/ChangeLog.API	Thu Jul 03 13:49:24 2008 +0000
@@ -17,7 +17,9 @@
 		* purple_buddy_icons_node_set_custom_icon_from_file
 		* purple_notify_user_info_prepend_section_break
 		* purple_notify_user_info_prepend_section_header
-	    * "website" and "dev_website" items to the ui_info hash table
+		* "website" and "dev_website" items to the ui_info hash table
+		* purple_cmds_get_handle, purple_cmds_init, purple_cmds_uninit
+		* cmd-added and cmd-removed signals
 
 		Deprecated:
 		* purple_blist_update_buddy_icon
--- a/ChangeLog.win32	Wed Jul 02 16:07:07 2008 +0000
+++ b/ChangeLog.win32	Thu Jul 03 13:49:24 2008 +0000
@@ -1,4 +1,4 @@
-version 2.4.3 (??/??/2008):
+version 2.4.3 (07/01/2008):
 	* No changes
 
 version 2.4.2 (05/17/2008):
--- a/NEWS	Wed Jul 02 16:07:07 2008 +0000
+++ b/NEWS	Thu Jul 03 13:49:24 2008 +0000
@@ -1,5 +1,9 @@
 Pidgin and Finch: The Pimpin' Penguin IM Clients That're Good for the Soul
 
+2.4.3 (07/01/2008):
+	Richard: This release includes important bug fixes.  I'm just cutting
+	the release.  Thank you to the real heroes who did the fixing!
+
 2.4.2 (5/17/2008):
 	Sadrul: We added some usability changes in this release, including the
 	typing notification, buddyicon and input area size in the conversation
--- a/configure.ac	Wed Jul 02 16:07:07 2008 +0000
+++ b/configure.ac	Thu Jul 03 13:49:24 2008 +0000
@@ -47,7 +47,7 @@
 m4_define([purple_major_version], [2])
 m4_define([purple_minor_version], [5])
 m4_define([purple_micro_version], [0])
-m4_define([purple_version_suffix], [devel])
+m4_define([purple_version_suffix], [])
 m4_define([purple_version],
           [purple_major_version.purple_minor_version.purple_micro_version])
 m4_define([purple_display_version], purple_version[]m4_ifdef([purple_version_suffix],[purple_version_suffix]))
@@ -56,7 +56,7 @@
 m4_define([gnt_major_version], [2])
 m4_define([gnt_minor_version], [5])
 m4_define([gnt_micro_version], [0])
-m4_define([gnt_version_suffix], [devel])
+m4_define([gnt_version_suffix], [])
 m4_define([gnt_version],
           [gnt_major_version.gnt_minor_version.gnt_micro_version])
 m4_define([gnt_display_version], gnt_version[]m4_ifdef([gnt_version_suffix],[gnt_version_suffix]))
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/cmd-signals.dox	Thu Jul 03 13:49:24 2008 +0000
@@ -0,0 +1,29 @@
+/** @page cmd-signals Command Signals
+  @signals
+  	@signal cmd-added
+	@signal cmd-removed
+  @endsignals
+
+  @see cmds.h
+
+  @signaldef cmd-added
+  	@signalproto
+void (*cmd_added)(const char *command, PurpleCmdPriority priority,
+                  PurpleCmdFlag flag);
+	@endsignalproto
+	@signaldesc
+	 Emitted when a new command is added.
+	@param command   The new command.
+	@param priority  The priority of the new command.
+	@param flag      The command flags.
+  @endsignaldef
+
+  @signaldef cmd-removed
+  	@signalproto
+void (*cmd_removed)(const char *command);
+	@endsignalproto
+	@signaldesc
+	 Emitted when a command is removed.
+	@param command   The removed command.
+  @endsignaldef
+*/
--- a/finch/gntconv.c	Wed Jul 02 16:07:07 2008 +0000
+++ b/finch/gntconv.c	Thu Jul 03 13:49:24 2008 +0000
@@ -692,11 +692,48 @@
 static void
 completion_cb(GntEntry *entry, const char *start, const char *end)
 {
-	if (start == entry->start)
+	if (start == entry->start && *start != '/')
 		gnt_widget_key_pressed(GNT_WIDGET(entry), ": ");
 }
 
 static void
+gg_setup_commands(FinchConv *fconv, gboolean remove_first)
+{
+	GList *commands;
+	char command[256] = "/";
+
+	if (remove_first) {
+		commands = purple_cmd_list(NULL);
+		for (; commands; commands = g_list_delete_link(commands, commands)) {
+			g_strlcpy(command + 1, commands->data, sizeof(command) - 1);
+			gnt_entry_remove_suggest(GNT_ENTRY(fconv->entry), command);
+		}
+	}
+
+	commands = purple_cmd_list(fconv->active_conv);
+	for (; commands; commands = g_list_delete_link(commands, commands)) {
+		g_strlcpy(command + 1, commands->data, sizeof(command) - 1);
+		gnt_entry_add_suggest(GNT_ENTRY(fconv->entry), command);
+	}
+}
+
+static void
+cmd_added_cb(const char *cmd, PurpleCmdPriority prior, PurpleCmdFlag flags,
+		FinchConv *fconv)
+{
+	gg_setup_commands(fconv, TRUE);
+}
+
+static void
+cmd_removed_cb(const char *cmd, FinchConv *fconv)
+{
+	char command[256] = "/";
+	g_strlcpy(command + 1, cmd, sizeof(command) - 1);
+	gnt_entry_remove_suggest(GNT_ENTRY(fconv->entry), command);
+	gg_setup_commands(fconv, TRUE);
+}
+
+static void
 finch_create_conversation(PurpleConversation *conv)
 {
 	FinchConv *ggc = FINCH_GET_DATA(conv);
@@ -819,6 +856,12 @@
 		ggc->flags |= FINCH_CONV_NO_SOUND;
 
 	gg_create_menu(ggc);
+	gg_setup_commands(ggc, FALSE);
+
+	purple_signal_connect(purple_cmds_get_handle(), "cmd-added", ggc,
+			G_CALLBACK(cmd_added_cb), ggc);
+	purple_signal_connect(purple_cmds_get_handle(), "cmd-removed", ggc,
+			G_CALLBACK(cmd_removed_cb), ggc);
 
 	g_free(title);
 	gnt_box_give_focus_to_child(GNT_BOX(ggc->window), ggc->entry);
@@ -831,11 +874,14 @@
 	/* do stuff here */
 	FinchConv *ggc = FINCH_GET_DATA(conv);
 	ggc->list = g_list_remove(ggc->list, conv);
-	if (ggc->list && conv == ggc->active_conv)
+	if (ggc->list && conv == ggc->active_conv) {
 		ggc->active_conv = ggc->list->data;
-	
+		gg_setup_commands(ggc, TRUE);
+	}
+
 	if (ggc->list == NULL) {
 		g_free(ggc->u.chat);
+		purple_signals_disconnect_by_handle(ggc);
 		if (ggc->window)
 			gnt_widget_destroy(ggc->window);
 		g_free(ggc);
@@ -1404,8 +1450,11 @@
 
 	g_return_if_fail(ggconv);
 	g_return_if_fail(g_list_find(ggconv->list, conv));
+	if (ggconv->active_conv == conv)
+		return;
 
 	ggconv->active_conv = conv;
+	gg_setup_commands(ggconv, TRUE);
 	account = purple_conversation_get_account(conv);
 	title = get_conversation_title(conv, account);
 	gnt_screen_rename_widget(ggconv->window, title);
--- a/libpurple/cmds.c	Wed Jul 02 16:07:07 2008 +0000
+++ b/libpurple/cmds.c	Thu Jul 03 13:49:24 2008 +0000
@@ -81,6 +81,8 @@
 
 	cmds = g_list_insert_sorted(cmds, c, (GCompareFunc)cmds_compare_func);
 
+	purple_signal_emit(purple_cmds_get_handle(), "cmd-added", cmd, p, f);
+
 	return id;
 }
 
@@ -103,6 +105,7 @@
 
 		if (c->id == id) {
 			cmds = g_list_remove(cmds, c);
+			purple_signal_emit(purple_cmds_get_handle(), "cmd-removed", c->cmd);
 			purple_cmd_free(c);
 			return;
 		}
@@ -361,3 +364,28 @@
 	return ret;
 }
 
+gpointer purple_cmds_get_handle(void)
+{
+	static int handle;
+	return &handle;
+}
+
+void purple_cmds_init(void)
+{
+	gpointer handle = purple_cmds_get_handle();
+
+	purple_signal_register(handle, "cmd-added",
+			purple_marshal_VOID__POINTER_INT_INT, NULL, 3,
+			purple_value_new(PURPLE_TYPE_STRING),
+			purple_value_new(PURPLE_TYPE_INT),
+			purple_value_new(PURPLE_TYPE_INT));
+	purple_signal_register(handle, "cmd-removed",
+			purple_marshal_VOID__POINTER, NULL, 1,
+			purple_value_new(PURPLE_TYPE_STRING));
+}
+
+void purple_cmds_uninit(void)
+{
+	purple_signals_unregister_by_instance(purple_cmds_get_handle());
+}
+
--- a/libpurple/cmds.h	Wed Jul 02 16:07:07 2008 +0000
+++ b/libpurple/cmds.h	Thu Jul 03 13:49:24 2008 +0000
@@ -1,6 +1,7 @@
 /**
  * @file cmds.h Commands API
  * @ingroup core
+ * @see @ref cmd-signals
  */
 
 /* Copyright (C) 2003 Timothy Ringenbach <omarvo@hotmail.com>
@@ -221,6 +222,25 @@
  */
 GList *purple_cmd_help(PurpleConversation *conv, const gchar *cmd);
 
+/**
+ * Get the handle for the commands API
+ * @return The handle
+ * @since 2.5.0
+ */
+gpointer purple_cmds_get_handle(void);
+
+/**
+ * Initialize the commands subsystem.
+ * @since 2.5.0
+ */
+void purple_cmds_init(void);
+
+/**
+ * Uninitialize the commands subsystem.
+ * @since 2.5.0
+ */
+void purple_cmds_uninit(void);
+
 /*@}*/
 
 #ifdef __cplusplus
--- a/libpurple/core.c	Wed Jul 02 16:07:07 2008 +0000
+++ b/libpurple/core.c	Thu Jul 03 13:49:24 2008 +0000
@@ -26,6 +26,7 @@
 #include "internal.h"
 #include "cipher.h"
 #include "certificate.h"
+#include "cmds.h"
 #include "connection.h"
 #include "conversation.h"
 #include "core.h"
@@ -169,6 +170,7 @@
 	purple_xfers_init();
 	purple_idle_init();
 	purple_smileys_init();
+	purple_cmds_init();
 
 	/*
 	 * Call this early on to try to auto-detect our IP address and
@@ -197,6 +199,7 @@
 	purple_connections_disconnect_all();
 
 	/* Save .xml files, remove signals, etc. */
+	purple_cmds_uninit();
 	purple_smileys_uninit();
 	purple_idle_uninit();
 	purple_ssl_uninit();
--- a/libpurple/protocols/qq/AUTHORS	Wed Jul 02 16:07:07 2008 +0000
+++ b/libpurple/protocols/qq/AUTHORS	Thu Jul 03 13:49:24 2008 +0000
@@ -9,11 +9,27 @@
 rakescar    : provided filter for HTML tag
 yyw         : improved performance on PPC linux
 lvxiang     : provided ip to location original code
-csyfek      : faces
 markhuetsch : OpenQ merge into libpurple, maintainer 2006-2007
+ccpaging    : maintainer since 2007
+icesky      : maintainer since 2007
+csyfek      : faces, maintainer since 2007
+
+Lovely Patch Writers
+=====
+Gnap.An     : message displaying, documentation
+manphiz     : qun processing
+moo         : qun processing
+Coly Li     : qun processing
 
 Acknowledgement
 =====
 Shufeng Tan : http://sf.net/projects/perl-oicq
 Jeff Ye     : http://www.sinomac.com
 Hu Zheng    : http://forlinux.yeah.net
+yunfan      : http://www.myswear.net
+khc@pidgin.im
+qulogic@pidgin.im
+rlaager@pidgin.im
+OpenQ Team
+LumaQQ Team
+OpenQ@GoogleGroup
--- a/libpurple/protocols/qq/ChangeLog	Wed Jul 02 16:07:07 2008 +0000
+++ b/libpurple/protocols/qq/ChangeLog	Thu Jul 03 13:49:24 2008 +0000
@@ -1,3 +1,14 @@
+2008.06.29 - csyfek <csyfek(at)gmail.com>
+	* Minor bug fix
+	* Add some doxygen syntax for preparing development documentation
+	* References #6199
+
+2008.06.28 - ccpaging <ecc_hy(at)hotmail.com>, moo <phpxcache(at)gmail.com>
+	* Patches from moo<phpxcache@gmail.com> and ccpaging<ccpaging@foxmail.com>.
+	* Tickets:
+	* Fixes #4956.
+	* Fixes #2998.
+
 2008.06.07 - ccpaging <ecc_hy(at)hotmail.com>, csyfek <csyfek(at)gmail.com>
 	* Clean code and apply patches from QuLogic
 
--- a/libpurple/protocols/qq/buddy_list.c	Wed Jul 02 16:07:07 2008 +0000
+++ b/libpurple/protocols/qq/buddy_list.c	Thu Jul 03 13:49:24 2008 +0000
@@ -147,6 +147,7 @@
 {
 	qq_data *qd;
 	gint len, bytes, bytes_buddy;
+	gint count;
 	guint8 *data, position;
 	PurpleBuddy *b;
 	qq_buddy *q_bud;
@@ -173,6 +174,7 @@
 	fe = g_newa(qq_friends_online_entry, 1);
 	fe->s = g_newa(qq_buddy_status, 1);
 
+	count = 0;
 	while (bytes < len) {
 		/* set flag */
 		bytes_buddy = bytes;
@@ -217,6 +219,7 @@
 			q_bud->flag1 = fe->flag1;
 			q_bud->comm_flag = fe->comm_flag;
 			qq_update_buddy_contact(gc, q_bud);
+			count++;
 		} else {
 			purple_debug(PURPLE_DEBUG_ERROR, "QQ", 
 					"Got an online buddy %d, but not in my buddy list\n", fe->s->uid);
@@ -232,10 +235,14 @@
 	}
 
 	if (position != QQ_FRIENDS_ONLINE_POSITION_END) {
-		purple_debug(PURPLE_DEBUG_INFO, "QQ", "Has more online buddies, position from %d\n", position);
-
+		purple_debug(PURPLE_DEBUG_INFO, "QQ", "Received %d online buddies, nextposition=%u\n",
+								count, (guint) position);
+		if (position != QQ_FRIENDS_ONLINE_POSITION_START) {
+			purple_debug(PURPLE_DEBUG_INFO, "QQ", "Requesting for more online buddies\n"); 
+		}
 		qq_send_packet_get_buddies_online(gc, position);
 	} else {
+		purple_debug(PURPLE_DEBUG_INFO, "QQ", "All online buddies received\n"); 
 		qq_send_packet_get_buddies_levels(gc);
 		qq_refresh_all_buddy_status(gc);
 	}
@@ -247,7 +254,7 @@
 {
 	qq_data *qd;
 	qq_buddy *q_bud;
-	gint len, bytes_expected, i;
+	gint len, bytes_expected, count;
 	gint bytes, buddy_bytes;
 	guint16 position, unknown;
 	guint8 *data, pascal_len;
@@ -267,7 +274,7 @@
 	bytes = 0;
 	bytes += qq_get16(&position, data + bytes);
 	/* the following data is buddy list in this packet */
-	i = 0;
+	count = 0;
 	while (bytes < len) {
 		q_bud = g_new0(qq_buddy, 1);
 		/* set flag */
@@ -306,7 +313,7 @@
 			g_free(q_bud);
 			continue;
 		} else {
-			i++;
+			count++;
 		}
 
 		if (QQ_DEBUG) {
@@ -332,11 +339,16 @@
 		purple_debug(PURPLE_DEBUG_ERROR, "QQ", 
 				"qq_process_get_buddies_list_reply: Dangerous error! maybe protocol changed, notify developers!");
 	}
-	if (position == QQ_FRIENDS_LIST_POSITION_END) {
-		purple_debug(PURPLE_DEBUG_INFO, "QQ", "Get friends list done, %d buddies\n", i);
-		qq_send_packet_get_buddies_online(gc, QQ_FRIENDS_ONLINE_POSITION_START);
+
+	purple_debug(PURPLE_DEBUG_INFO, "QQ", "Received %d buddies, nextposition=%u\n",
+		count, (guint) position);
+	if (position != QQ_FRIENDS_LIST_POSITION_START
+		&& position != QQ_FRIENDS_LIST_POSITION_END) { 
+		purple_debug(PURPLE_DEBUG_INFO, "QQ", "Requesting for more buddies\n"); 
+		qq_send_packet_get_buddies_list(gc, position);
 	} else {
-		qq_send_packet_get_buddies_list(gc, position);
+		purple_debug(PURPLE_DEBUG_INFO, "QQ", "All buddies received. Requesting for online buddies list\n");
+		qq_send_packet_get_buddies_online(gc, QQ_FRIENDS_LIST_POSITION_START); 
 	}
 }
 
@@ -419,4 +431,11 @@
 	}
 
 	purple_debug(PURPLE_DEBUG_INFO, "QQ", "Get all list done, %d buddies and %d Quns\n", i, j);
+	purple_debug(PURPLE_DEBUG_INFO, "QQ", "Received %d buddies and %d groups, nextposition=%u\n", i, j, (guint) position);
+	if (position != QQ_FRIENDS_ALL_LIST_POSITION_START && position != QQ_FRIENDS_ALL_LIST_POSITION_START) {
+		purple_debug(PURPLE_DEBUG_INFO, "QQ", "Requesting for more buddies and groups\n");
+		qq_send_packet_get_all_list_with_group(gc, position);
+	} else {
+		purple_debug(PURPLE_DEBUG_INFO, "QQ", "All buddies and groups received\n"); 
+	}
 }
--- a/libpurple/protocols/qq/buddy_list.h	Wed Jul 02 16:07:07 2008 +0000
+++ b/libpurple/protocols/qq/buddy_list.h	Thu Jul 03 13:49:24 2008 +0000
@@ -32,6 +32,8 @@
 #define QQ_FRIENDS_LIST_POSITION_END 		0xffff
 #define QQ_FRIENDS_ONLINE_POSITION_START 	0x00
 #define QQ_FRIENDS_ONLINE_POSITION_END 		0xff
+#define QQ_FRIENDS_ALL_LIST_POSITION_START  0x00000000
+#define QQ_FRIENDS_ALL_LIST_POSITION_END  0xffffffff
 
 void qq_send_packet_get_buddies_online(PurpleConnection *gc, guint8 position);
 void qq_process_get_buddies_online_reply(guint8 *buf, gint buf_len, PurpleConnection *gc);
--- a/libpurple/protocols/qq/char_conv.c	Wed Jul 02 16:07:07 2008 +0000
+++ b/libpurple/protocols/qq/char_conv.c	Thu Jul 03 13:49:24 2008 +0000
@@ -123,9 +123,14 @@
 	return g_strdup(QQ_NULL_MSG);
 }
 
-/* take the input as a pascal string and return a converted c-string in UTF-8
+/**
+ * @brief 把输入作为一个pascal字符串并返回一个用UFT-8转换的c-字符串.\n
+ * 返回已读入的字节数,或者当遇到错误时返回-1.该完成转换的UTF-8字符串被保存到ret中
+ *
+ * take the input as a pascal string and return a converted c-string in UTF-8
  * returns the number of bytes read, return -1 if fatal error
- * the converted UTF-8 will be saved in ret */
+ * the converted UTF-8 will be saved in ret
+ */ 
 gint convert_as_pascal_string(guint8 *data, gchar **ret, const gchar *from_charset) 
 {
 	guint8 len;
--- a/libpurple/protocols/qq/group_info.c	Wed Jul 02 16:07:07 2008 +0000
+++ b/libpurple/protocols/qq/group_info.c	Thu Jul 03 13:49:24 2008 +0000
@@ -141,6 +141,9 @@
 	qq_send_group_cmd(gc, group, raw_data, bytes);
 }
 
+/**
+ * @brief 处理群信息.当前群信息的处理还不完善,由于版本的不同导致协议的解读有差异.
+ */
 void qq_process_group_cmd_get_group_info(guint8 *data, gint len, PurpleConnection *gc)
 {
 	qq_group *group;
@@ -163,7 +166,7 @@
 	g_return_if_fail(internal_group_id > 0);
 
 	bytes += qq_get32(&(external_group_id), data + bytes);
-	g_return_if_fail(internal_group_id > 0);
+	g_return_if_fail(external_group_id > 0);
 
 	pending_id = qq_get_pending_id(qd->adding_groups_from_server, internal_group_id);
 	if (pending_id != NULL) {
@@ -183,13 +186,24 @@
 	bytes += qq_get32(&(group->group_category), data + bytes);
 	bytes += qq_get16(&max_members, data + bytes);
 	bytes += qq_get8(&unknown1, data + bytes);
-	bytes += qq_get32(&(unknown4), data + bytes);	/* versionID */
-
+	/* XXX
+	 * the following, while Eva:
+	 * 4(unk), 4(verID), 1(nameLen), nameLen(qunNameContent), 1(0x00),
+	 * 2(qunNoticeLen), qunNoticeLen(qunNoticeContent, 1(qunDescLen),
+	 * qunDestLen(qunDestcontent)) */
+	bytes += qq_get8(&unknown1, data + bytes);
+	purple_debug(PURPLE_DEBUG_INFO, "QQ", "type=%u creatorid=%u category=%u\n",
+			group->group_type, group->creator_uid, group->group_category);
+	purple_debug(PURPLE_DEBUG_INFO, "QQ", "maxmembers=%u", max_members); 
+	
 	/* strlen + <str content> */
 	bytes += convert_as_pascal_string(data + bytes, &(group->group_name_utf8), QQ_CHARSET_DEFAULT);
+	purple_debug(PURPLE_DEBUG_INFO, "QQ", "group \"%s\"\n", group->group_name_utf8); 
 	bytes += qq_get16(&unknown, data + bytes);	/* 0x0000 */
 	bytes += convert_as_pascal_string(data + bytes, &(group->notice_utf8), QQ_CHARSET_DEFAULT);
+	purple_debug(PURPLE_DEBUG_INFO, "QQ", "notice \"%s\"\n", group->notice_utf8); 
 	bytes += convert_as_pascal_string(data + bytes, &(group->group_desc_utf8), QQ_CHARSET_DEFAULT);
+	purple_debug(PURPLE_DEBUG_INFO, "QQ", "group_desc \"%s\"\n", group->group_desc_utf8); 
 
 	num = 0;
 	/* now comes the member list separated by 0x00 */
--- a/libpurple/protocols/qq/group_internal.c	Wed Jul 02 16:07:07 2008 +0000
+++ b/libpurple/protocols/qq/group_internal.c	Thu Jul 03 13:49:24 2008 +0000
@@ -230,7 +230,9 @@
 		*list = g_slist_remove(*list, GINT_TO_POINTER(id));
 }
 
-/* Return the location of id in list, or NULL if not found */
+/**
+ * @brief Return the location of id in list, or NULL if not found (返回id在链表中的位置,没有找到则返回NULL)
+ */
 GSList *qq_get_pending_id(GSList *list, guint32 id)
 {
         return g_slist_find(list, GINT_TO_POINTER(id));
--- a/libpurple/protocols/qq/im.c	Wed Jul 02 16:07:07 2008 +0000
+++ b/libpurple/protocols/qq/im.c	Thu Jul 03 13:49:24 2008 +0000
@@ -384,8 +384,9 @@
 			im_unprocessed->length = len - bytes;
 			/* a simple process here, maybe more later */
 			purple_debug (PURPLE_DEBUG_WARNING, "QQ",
-					"Normal IM, unprocessed type [0x%04x], unknown [0x%02x], len %d\n",
-					common->normal_im_type, im_unprocessed->unknown, im_unprocessed->length);
+					"Normal IM, unprocessed type [0x%04x], len %d\n",
+					common->normal_im_type, im_unprocessed->length);
+			qq_show_packet ("QQ unk-im", im_unprocessed->unknown, im_unprocessed->length);
 			g_free (common->session_md5);
 			return;
 	}
--- a/libpurple/protocols/qq/qq_network.c	Wed Jul 02 16:07:07 2008 +0000
+++ b/libpurple/protocols/qq/qq_network.c	Thu Jul 03 13:49:24 2008 +0000
@@ -933,7 +933,7 @@
 			return;
 		}
 
-	purple_debug(PURPLE_DEBUG_ERROR, "QQ", "Connection failed: %d\n", g_strerror(errno));
+	purple_debug(PURPLE_DEBUG_ERROR, "QQ", "Connection failed: %s\n", g_strerror(errno));
 	close(fd);
 }
 
--- a/libpurple/protocols/qq/utils.c	Wed Jul 02 16:07:07 2008 +0000
+++ b/libpurple/protocols/qq/utils.c	Thu Jul 03 13:49:24 2008 +0000
@@ -293,12 +293,12 @@
 	str = g_string_new("");
 	for (i = 0; i < bytes; i += 16) {
 		/* length label */
-		g_string_append_printf(str, "%04d: ", i);
+		g_string_append_printf(str, "%07x: ", i);
 
 		/* dump hex value */
 		for (j = 0; j < 16; j++)
 			if ((i + j) < bytes)
-				g_string_append_printf(str, " %02X", buffer[i + j]);
+				g_string_append_printf(str, " %02x", buffer[i + j]);
 			else
 				g_string_append(str, "   ");
 		g_string_append(str, "  ");