changeset 20812:88aa557b997f

propagate from branch 'im.pidgin.pidgin' (head 017296ee954fb91349806c809983c916842603da) to branch 'im.pidgin.cpw.resiak.disconnectreason' (head 8648cc67b0f11cdb0c5d48a703bca11b56606a16)
author Will Thompson <will.thompson@collabora.co.uk>
date Sun, 07 Oct 2007 10:28:32 +0000
parents 368d79355aba (diff) 682543aced31 (current diff)
children 66e7b104b4ea
files libpurple/connection.h libpurple/protocols/irc/msgs.c libpurple/protocols/irc/parse.c
diffstat 33 files changed, 198 insertions(+), 92 deletions(-) [+]
line wrap: on
line diff
--- a/.mtn-ignore	Sat Oct 06 12:05:22 2007 +0000
+++ b/.mtn-ignore	Sun Oct 07 10:28:32 2007 +0000
@@ -21,7 +21,7 @@
 config.status
 config.sub
 configure$
-finch/finch
+finch/finch$
 finch/libgnt/gntmarshal.c
 finch/libgnt/gntmarshal.h
 depcomp
--- a/configure.ac	Sat Oct 06 12:05:22 2007 +0000
+++ b/configure.ac	Sun Oct 07 10:28:32 2007 +0000
@@ -2247,6 +2247,7 @@
 		   share/Makefile
 		   share/sounds/Makefile
 		   share/ca-certs/Makefile
+		   finch/finch.pc
 		   finch/Makefile
 		   finch/libgnt/Makefile
 		   finch/libgnt/gnt.pc
--- a/doc/gtkconv-signals.dox	Sat Oct 06 12:05:22 2007 +0000
+++ b/doc/gtkconv-signals.dox	Sun Oct 07 10:28:32 2007 +0000
@@ -12,6 +12,8 @@
   @signal conversation-displayed
  @endsignals
 
+ @see gtkconv.h
+
  <hr>
 
  @signaldef conversation-dragging
@@ -132,7 +134,7 @@
 void (*conversation_displayed)(PidginConversation *gtkconv);
   @endsignalproto
   @signaldesc
-   Emitted right after the Pidgin UI is reattached to a conversation.
+   Emitted right after the Pidgin UI is attached to a new or a hidden conversation.
   @param gtkconv  The PidginConversation
  @endsignaldef
 
--- a/finch/Makefile.am	Sat Oct 06 12:05:22 2007 +0000
+++ b/finch/Makefile.am	Sun Oct 07 10:28:32 2007 +0000
@@ -1,7 +1,11 @@
 EXTRA_DIST = \
 		getopt.c \
 		getopt.h \
-		getopt1.c
+		getopt1.c \
+		finch.pc.in
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = finch.pc
 
 SUBDIRS = libgnt plugins
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/finch/finch.pc.in	Sun Oct 07 10:28:32 2007 +0000
@@ -0,0 +1,13 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+datadir=@datadir@
+sysconfdir=@sysconfdir@
+
+Name: Finch
+Description: Finch is an instant messenger application that uses libpurple for protocol support and ncurses (libgnt) for the UI.
+Version: @VERSION@
+Requires: gnt purple
+Cflags: -I${includedir}/finch
+
--- a/libpurple/account.h	Sat Oct 06 12:05:22 2007 +0000
+++ b/libpurple/account.h	Sun Oct 07 10:28:32 2007 +0000
@@ -1,6 +1,7 @@
 /**
  * @file account.h Account API
  * @ingroup core
+ * @see @ref account-signals
  */
 
 /* purple
@@ -22,8 +23,6 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
- *
- * @see @ref account-signals
  */
 #ifndef _PURPLE_ACCOUNT_H_
 #define _PURPLE_ACCOUNT_H_
--- a/libpurple/blist.h	Sat Oct 06 12:05:22 2007 +0000
+++ b/libpurple/blist.h	Sun Oct 07 10:28:32 2007 +0000
@@ -1,6 +1,7 @@
 /**
  * @file blist.h Buddy List API
  * @ingroup core
+ * @see @ref blist-signals
  */
 
 /* purple
@@ -22,8 +23,6 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
- *
- * @see @ref blist-signals
  */
 #ifndef _PURPLE_BLIST_H_
 #define _PURPLE_BLIST_H_
--- a/libpurple/certificate.h	Sat Oct 06 12:05:22 2007 +0000
+++ b/libpurple/certificate.h	Sun Oct 07 10:28:32 2007 +0000
@@ -1,6 +1,7 @@
 /**
  * @file certificate.h Public-Key Certificate API
  * @ingroup core
+ * @see @ref certificate-signals
  */
 
 /*
--- a/libpurple/cipher.h	Sat Oct 06 12:05:22 2007 +0000
+++ b/libpurple/cipher.h	Sun Oct 07 10:28:32 2007 +0000
@@ -1,6 +1,7 @@
 /**
  * @file cipher.h Purple Cipher API
  * @ingroup core
+ * @see @ref cipher-signals
  */
 
 /* purple
@@ -22,8 +23,6 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
- *
- * @see @ref cipher-signals
  */
 #ifndef PURPLE_CIPHER_H
 #define PURPLE_CIPHER_H
--- a/libpurple/connection.h	Sat Oct 06 12:05:22 2007 +0000
+++ b/libpurple/connection.h	Sun Oct 07 10:28:32 2007 +0000
@@ -1,6 +1,7 @@
 /**
  * @file connection.h Connection API
  * @ingroup core
+ * @see @ref connection-signals
  */
 
 /* purple
@@ -22,8 +23,6 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
- *
- * @see @ref connection-signals
  */
 #ifndef _PURPLE_CONNECTION_H_
 #define _PURPLE_CONNECTION_H_
--- a/libpurple/conversation.h	Sat Oct 06 12:05:22 2007 +0000
+++ b/libpurple/conversation.h	Sun Oct 07 10:28:32 2007 +0000
@@ -1,6 +1,7 @@
 /**
  * @file conversation.h Conversation API
  * @ingroup core
+ * @see @ref conversation-signals
  */
 
 /* purple
@@ -22,8 +23,6 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
- *
- * @see @ref conversation-signals
  */
 #ifndef _PURPLE_CONVERSATION_H_
 #define _PURPLE_CONVERSATION_H_
--- a/libpurple/core.h	Sat Oct 06 12:05:22 2007 +0000
+++ b/libpurple/core.h	Sun Oct 07 10:28:32 2007 +0000
@@ -1,5 +1,6 @@
 /**
  * @defgroup core libpurple
+ * @see @ref core-signals
  */
 
 /* purple
@@ -21,8 +22,6 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
- *
- * @see @ref core-signals
  */
 #ifndef _PURPLE_CORE_H_
 #define _PURPLE_CORE_H_
--- a/libpurple/dbus-server.h	Sat Oct 06 12:05:22 2007 +0000
+++ b/libpurple/dbus-server.h	Sun Oct 07 10:28:32 2007 +0000
@@ -1,6 +1,7 @@
 /**
  * @file dbus-server.h Purple DBUS Server
  * @ingroup core
+ * @see @ref dbus-server-signals
  */
 
 /* purple
@@ -22,8 +23,6 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
- *
- * @see @ref dbus-server-signals
  */
 
 #ifndef _PURPLE_DBUS_SERVER_H_
--- a/libpurple/ft.h	Sat Oct 06 12:05:22 2007 +0000
+++ b/libpurple/ft.h	Sun Oct 07 10:28:32 2007 +0000
@@ -1,6 +1,7 @@
 /**
  * @file ft.h File Transfer API
  * @ingroup core
+ * @see @ref xfer-signals
  */
 
 /* purple
@@ -22,8 +23,6 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
- *
- * @see @ref xfer-signals
  */
 #ifndef _PURPLE_FT_H_
 #define _PURPLE_FT_H_
--- a/libpurple/gaim-compat.h	Sat Oct 06 12:05:22 2007 +0000
+++ b/libpurple/gaim-compat.h	Sun Oct 07 10:28:32 2007 +0000
@@ -22,8 +22,6 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
- *
- * @see @ref account-signals
  */
 #ifndef _GAIM_COMPAT_H_
 #define _GAIM_COMPAT_H_
--- a/libpurple/imgstore.h	Sat Oct 06 12:05:22 2007 +0000
+++ b/libpurple/imgstore.h	Sun Oct 07 10:28:32 2007 +0000
@@ -1,6 +1,7 @@
 /**
  * @file imgstore.h IM Image Store API
  * @ingroup core
+ * @see @ref imgstore-signals
  */
 
 /* purple
@@ -22,8 +23,6 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
- *
- * @see @ref imgstore-signals
  */
 #ifndef _PURPLE_IMGSTORE_H_
 #define _PURPLE_IMGSTORE_H_
--- a/libpurple/log.h	Sat Oct 06 12:05:22 2007 +0000
+++ b/libpurple/log.h	Sun Oct 07 10:28:32 2007 +0000
@@ -1,6 +1,7 @@
 /**
  * @file log.h Logging API
  * @ingroup core
+ * @see @ref log-signals
  */
 
 /* purple
@@ -22,8 +23,6 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
- *
- * @see @ref log-signals
  */
 #ifndef _PURPLE_LOG_H_
 #define _PURPLE_LOG_H_
--- a/libpurple/notify.h	Sat Oct 06 12:05:22 2007 +0000
+++ b/libpurple/notify.h	Sun Oct 07 10:28:32 2007 +0000
@@ -1,6 +1,7 @@
 /**
  * @file notify.h Notification API
  * @ingroup core
+ * @see @ref notify-signals
  */
 
 /* purple
@@ -22,8 +23,6 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
- *
- * @see @ref notify-signals
  */
 #ifndef _PURPLE_NOTIFY_H_
 #define _PURPLE_NOTIFY_H_
--- a/libpurple/plugin.h	Sat Oct 06 12:05:22 2007 +0000
+++ b/libpurple/plugin.h	Sun Oct 07 10:28:32 2007 +0000
@@ -1,6 +1,9 @@
 /**
  * @file plugin.h Plugin API
  * @ingroup core
+ * @see @ref plugin-signals
+ * @see @ref plugin-ids
+ * @see @ref plugin-i18n
  */
 
 /* purple
@@ -22,10 +25,6 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
- *
- * @see @ref plugin-signals
- * @see @ref plugin-ids
- * @see @ref plugin-i18n
  */
 #ifndef _PURPLE_PLUGIN_H_
 #define _PURPLE_PLUGIN_H_
--- a/libpurple/plugins/log_reader.c	Sat Oct 06 12:05:22 2007 +0000
+++ b/libpurple/plugins/log_reader.c	Sun Oct 07 10:28:32 2007 +0000
@@ -232,7 +232,6 @@
 	struct adium_logger_data *data;
 	GError *error = NULL;
 	gchar *read = NULL;
-	gsize length;
 
 	/* XXX: TODO: We probably want to set PURPLE_LOG_READ_NO_NEWLINE
 	 * XXX: TODO: for HTML logs. */
@@ -246,8 +245,9 @@
 	g_return_val_if_fail(data->path != NULL, g_strdup(""));
 
 	purple_debug_info("Adium log read", "Reading %s\n", data->path);
-	if (!g_file_get_contents(data->path, &read, &length, &error)) {
-		purple_debug_error("Adium log read", "Error reading log\n");
+	if (!g_file_get_contents(data->path, &read, NULL, &error)) {
+		purple_debug_error("Adium log read", "Error reading log: %s\n",
+					   (error && error->message) ? error->message : "Unknown error");
 		if (error)
 			g_error_free(error);
 		return g_strdup("");
@@ -1808,8 +1808,10 @@
 	error = NULL;
 	if (!g_file_get_contents(path, &contents, NULL, &error)) {
 		purple_debug_error("QIP logger",
-		                   "Couldn't read file %s: %s \n", path, error->message);
-		g_error_free(error);
+				   "Couldn't read file %s: %s \n", path,
+				   (error && error->message) ? error->message : "Unknown error");
+		if (error)
+			g_error_free(error);
 		g_free(path);
 		return list;
 	}
@@ -1955,8 +1957,10 @@
 	error = NULL;
 	if (!(utf8_string = g_convert(contents, -1, "UTF-8", "Cp1251", NULL, NULL, &error))) {
 		purple_debug_error("QIP logger",
-			"Couldn't convert file %s to UTF-8: %s\n", data->path, error->message);
-		g_error_free(error);
+			"Couldn't convert file %s to UTF-8: %s\n", data->path,
+				   (error && error->message) ? error->message : "Unknown error");
+		if (error)
+			g_error_free(error);
 		g_free(contents);
 		return g_strdup("");
 	}
@@ -2151,18 +2155,18 @@
 
 	/* Calculate default Messenger Plus! log directory. */
 #ifdef _WIN32
+	path = NULL;
 	folder = wpurple_get_special_folder(CSIDL_PERSONAL);
 	if (folder) {
 		path = g_build_filename(folder, "My Chat Logs", NULL);
 		g_free(folder);
-	} else
-		path = g_strdup("");
+	}
 #else
 	path = g_build_filename(PURPLE_LOG_READER_WINDOWS_MOUNT_POINT,
 	                        "Documents and Settings", g_get_user_name(),
 	                        "My Documents", "My Chat Logs", NULL);
 #endif
-	purple_prefs_add_string("/plugins/core/log_reader/messenger_plus/log_directory", path);
+	purple_prefs_add_string("/plugins/core/log_reader/messenger_plus/log_directory", path ? path : "");
 	g_free(path);
 
 
@@ -2171,18 +2175,18 @@
 
 	/* Calculate default MSN message history directory. */
 #ifdef _WIN32
+	path = NULL;
 	folder = wpurple_get_special_folder(CSIDL_PERSONAL);
 	if (folder) {
 		path = g_build_filename(folder, "My Received Files", NULL);
 		g_free(folder);
-	} else
-		path = g_strdup("");
+	}
 #else
 	path = g_build_filename(PURPLE_LOG_READER_WINDOWS_MOUNT_POINT,
 	                        "Documents and Settings", g_get_user_name(),
 	                        "My Documents", "My Received Files", NULL);
 #endif
-	purple_prefs_add_string("/plugins/core/log_reader/msn/log_directory", path);
+	purple_prefs_add_string("/plugins/core/log_reader/msn/log_directory", path ? path : "");
 	g_free(path);
 
 
@@ -2261,22 +2265,22 @@
 			g_key_file_free(key_file);
 		}
 #else /* !GLIB_CHECK_VERSION(2,6,0) */
-		gsize length;
 		gchar *contents = NULL;
 
 		purple_debug_info("Trillian talk.ini read",
-					"Reading %s\n", path);
-		if (!g_file_get_contents(path, &contents, &length, &error)) {
+				  "Reading %s\n", path);
+		if (!g_file_get_contents(path, &contents, NULL, &error)) {
 			purple_debug_error("Trillian talk.ini read",
-			                   "Error reading talk.ini\n");
+					   "Error reading talk.ini: %s\n",
+					   (error && error->message) ? error->message : "Unknown error");
 			if (error)
 				g_error_free(error);
-			g_free(path);
 		} else {
-			char *line = contents;
-			while (*contents) {
-				if (*contents == '\n') {
-					*contents = '\0';
+			char *cursor, *line;
+			line = cursor = contents;
+			while (*cursor) {
+				if (*cursor == '\n') {
+					*cursor = '\0';
 
 					/* XXX: This assumes the first Directory key is under [Logging]. */
 					if (purple_str_has_prefix(line, "Directory=")) {
@@ -2288,25 +2292,29 @@
 						found = TRUE;
 					}
 
-					contents++;
-					line = contents;
+					cursor++;
+					line = cursor;
 				} else
-					contents++;
+					cursor++;
 			}
-			g_free(path);
 			g_free(contents);
 		}
+		g_free(path);
 #endif /* !GTK_CHECK_VERSION(2,6,0) */
 	} /* path */
 
 	if (!found) {
+		path = NULL;
 		folder = wpurple_get_special_folder(CSIDL_PROGRAM_FILES);
 		if (folder) {
 			path = g_build_filename(folder, "Trillian", "users",
 			                        "default", "logs", NULL);
 			g_free(folder);
-		} else
-			path = g_strdup("");
+		}
+
+		purple_prefs_add_string(
+			"/plugins/core/log_reader/trillian/log_directory", path ? path : "");
+		g_free(path);
 	}
 #else /* !defined(_WIN32) */
 	/* TODO: At some point, this could attempt to parse talk.ini
@@ -2317,28 +2325,27 @@
 	path = g_build_filename(PURPLE_LOG_READER_WINDOWS_MOUNT_POINT,
 	                        "Program Files", "Trillian", "users",
 	                        "default", "logs", NULL);
+	purple_prefs_add_string(
+		"/plugins/core/log_reader/trillian/log_directory", path);
+	g_free(path);
 #endif
 
-	/*XXX: Why do we even bother allocating it ? */
-	g_free(path);
-
-
 	/* Add QIP log directory preference. */
 	purple_prefs_add_none("/plugins/core/log_reader/qip");
 
 	/* Calculate default QIP log directory. */
 #ifdef _WIN32
+	path = NULL;
 	folder = wpurple_get_special_folder(CSIDL_PROGRAM_FILES);
 	if (folder) {
 		path = g_build_filename(folder, "QIP", "Users", NULL);
 		g_free(folder);
-	} else
-		path = g_strdup("");
+	}
 #else
 	path = g_build_filename(PURPLE_LOG_READER_WINDOWS_MOUNT_POINT,
 	                        "Program Files", "QIP", "Users", NULL);
 #endif
-	purple_prefs_add_string("/plugins/core/log_reader/qip/log_directory", path);
+	purple_prefs_add_string("/plugins/core/log_reader/qip/log_directory", path ? path : "");
 	g_free(path);
 }
 
--- a/libpurple/protocols/irc/irc.h	Sat Oct 06 12:05:22 2007 +0000
+++ b/libpurple/protocols/irc/irc.h	Sun Oct 07 10:28:32 2007 +0000
@@ -99,6 +99,8 @@
 int irc_send(struct irc_conn *irc, const char *buf);
 gboolean irc_blist_timeout(struct irc_conn *irc);
 
+char *irc_escape_privmsg(const char *text, gssize length);
+
 char *irc_mirc2html(const char *string);
 char *irc_mirc2txt(const char *string);
 
--- a/libpurple/protocols/irc/msgs.c	Sat Oct 06 12:05:22 2007 +0000
+++ b/libpurple/protocols/irc/msgs.c	Sun Oct 07 10:28:32 2007 +0000
@@ -1066,7 +1066,7 @@
 		return;
 	}
 
-	msg = g_markup_escape_text(tmp, -1);
+	msg = irc_escape_privmsg(tmp, -1);
 	g_free(tmp);
 
 	tmp = irc_mirc2html(msg);
--- a/libpurple/protocols/irc/parse.c	Sat Oct 06 12:05:22 2007 +0000
+++ b/libpurple/protocols/irc/parse.c	Sun Oct 07 10:28:32 2007 +0000
@@ -281,6 +281,61 @@
 	return purple_utf8_salvage(string);
 }
 
+/* This function is shamelessly stolen from glib--it is an old version of the
+ * private function append_escaped_text, used by g_markup_escape_text, whose
+ * behavior changed in glib 2.12. */
+static void irc_append_escaped_text(GString *str, const char *text, gssize length)
+{
+	const char *p = text;
+	const char *end = text + length;
+	const char *next = NULL;
+
+	while(p != end) {
+		next = g_utf8_next_char(p);
+
+		switch(*p) {
+			case '&':
+				g_string_append(str, "&amp;");
+				break;
+			case '<':
+				g_string_append(str, "&lt;");
+				break;
+			case '>':
+				g_string_append(str, "&gt;");
+				break;
+			case '\'':
+				g_string_append(str, "&apos;");
+				break;
+			case '"':
+				g_string_append(str, "&quot;");
+				break;
+			default:
+				g_string_append_len(str, p, next - p);
+				break;
+		}
+
+		p = next;
+	}
+}
+
+/* This function is shamelessly stolen from glib--it is an old version of the
+ * function g_markup_escape_text, whose behavior changed in glib 2.12. */
+char *irc_escape_privmsg(const char *text, gssize length)
+{
+	GString *str;
+
+	g_return_val_if_fail(text != NULL, NULL);
+
+	if(length < 0)
+		length = strlen(text);
+
+	str = g_string_sized_new(length);
+
+	irc_append_escaped_text(str, text, length);
+
+	return g_string_free(str, FALSE);
+}
+
 /* XXX tag closings are not necessarily correctly nested here!  If we
  *     get a ^O or reach the end of the string and there are open
  *     tags, they are closed in a fixed order ... this means, for
--- a/libpurple/savedstatuses.h	Sat Oct 06 12:05:22 2007 +0000
+++ b/libpurple/savedstatuses.h	Sun Oct 07 10:28:32 2007 +0000
@@ -1,6 +1,7 @@
 /**
  * @file savedstatuses.h Saved Status API
  * @ingroup core
+ * @see @ref savedstatus-signals
  */
 
 /* purple
@@ -22,8 +23,6 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
- *
- * @see @ref savedstatus-signals
  */
 #ifndef _PURPLE_SAVEDSTATUSES_H_
 #define _PURPLE_SAVEDSTATUSES_H_
--- a/libpurple/sound.h	Sat Oct 06 12:05:22 2007 +0000
+++ b/libpurple/sound.h	Sun Oct 07 10:28:32 2007 +0000
@@ -1,6 +1,7 @@
 /**
  * @file sound.h Sound API
  * @ingroup core
+ * @see @ref sound-signals
  */
 
 /* purple
@@ -22,8 +23,6 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
- *
- * @see @ref sound-signals
  */
 #ifndef _PURPLE_SOUND_H_
 #define _PURPLE_SOUND_H_
--- a/pidgin/gtkaccount.h	Sat Oct 06 12:05:22 2007 +0000
+++ b/pidgin/gtkaccount.h	Sun Oct 07 10:28:32 2007 +0000
@@ -1,6 +1,7 @@
 /**
  * @file gtkaccount.h GTK+ Account Editor UI
  * @ingroup pidgin
+ * @see @ref gtkaccount-signals
  */
 
 /* pidgin
--- a/pidgin/gtkblist.c	Sat Oct 06 12:05:22 2007 +0000
+++ b/pidgin/gtkblist.c	Sun Oct 07 10:28:32 2007 +0000
@@ -3070,7 +3070,7 @@
 	{ N_("/Buddies/Get User _Info..."), "<CTL>I", pidgin_dialogs_info, 0, "<StockItem>", PIDGIN_STOCK_TOOLBAR_USER_INFO },
 	{ N_("/Buddies/View User _Log..."), "<CTL>L", pidgin_dialogs_log, 0, "<Item>", NULL },
 	{ "/Buddies/sep1", NULL, NULL, 0, "<Separator>", NULL },
-	{ N_("/Buddies/Show"), NULL, NULL, 0, "<Branch>", NULL},
+	{ N_("/Buddies/Sh_ow"), NULL, NULL, 0, "<Branch>", NULL},
 	{ N_("/Buddies/Show/_Offline Buddies"), NULL, pidgin_blist_edit_mode_cb, 1, "<CheckItem>", NULL },
 	{ N_("/Buddies/Show/_Empty Groups"), NULL, pidgin_blist_show_empty_groups_cb, 1, "<CheckItem>", NULL },
 	{ N_("/Buddies/Show/Buddy _Details"), NULL, pidgin_blist_buddy_details_cb, 1, "<CheckItem>", NULL },
@@ -3663,25 +3663,31 @@
 			else
 				idletime = g_strdup(_("Idle"));
 
-			if (!selected)
+			if (!selected) {
+				g_free(text);
 				text = g_strdup_printf("<span color='%s'>%s</span>\n"
-				"<span color='%s' size='smaller'>%s%s%s</span>",
-				dim_grey(), esc, dim_grey(),
-				idletime != NULL ? idletime : "",
-				(idletime != NULL && statustext != NULL) ? " - " : "",
-				statustext != NULL ? statustext : "");
+					"<span color='%s' size='smaller'>%s%s%s</span>",
+					dim_grey(), esc, dim_grey(),
+					idletime != NULL ? idletime : "",
+					(idletime != NULL && statustext != NULL) ? " - " : "",
+					statustext != NULL ? statustext : "");
+			}
 		}
-		else if (!selected && !statustext) /* We handle selected text later */
+		else if (!selected && !statustext) {/* We handle selected text later */
+			g_free(text);
 			text = g_strdup_printf("<span color='%s'>%s</span>", dim_grey(), esc);
-		else if (!selected && !text)
+		} else if (!selected && !text) {
+			g_free(text);
 			text = g_strdup_printf("<span color='%s'>%s</span>\n"
 				"<span color='%s' size='smaller'>%s</span>",
 				dim_grey(), esc, dim_grey(),
 				statustext != NULL ? statustext : "");
+		}
 	} else if (!PURPLE_BUDDY_IS_ONLINE(b)) {
-		if (!selected && !statustext) /* We handle selected text later */
+		if (!selected && !statustext) {/* We handle selected text later */
+			g_free(text);
 			text = g_strdup_printf("<span color='%s'>%s</span>", dim_grey(), esc);
-		else if (!selected && !text)
+		} else if (!selected && !text)
 			text = g_strdup_printf("<span color='%s'>%s</span>\n"
 				"<span color='%s' size='smaller'>%s</span>",
 				dim_grey(), esc, dim_grey(),
@@ -3698,13 +3704,15 @@
 	}
 
 	/* It is selected. */
-	if ((selected && !text) || (selected && idletime))
+	if ((selected && !text) || (selected && idletime)) {
+		g_free(text);
 		text = g_strdup_printf("%s\n"
 			"<span size='smaller'>%s%s%s</span>",
 			esc,
 			idletime != NULL ? idletime : "",
 			(idletime != NULL && statustext != NULL) ? " - " : "",
 			statustext != NULL ? statustext :  "");
+	}
 
 	g_free(idletime);
 	g_free(statustext);
--- a/pidgin/gtkblist.h	Sat Oct 06 12:05:22 2007 +0000
+++ b/pidgin/gtkblist.h	Sun Oct 07 10:28:32 2007 +0000
@@ -1,6 +1,7 @@
 /**
  * @file gtkblist.h GTK+ Buddy List API
  * @ingroup pidgin
+ * @see @ref gtkblist-signals
  */
 
 /* pidgin
--- a/pidgin/gtkconv.c	Sat Oct 06 12:05:22 2007 +0000
+++ b/pidgin/gtkconv.c	Sun Oct 07 10:28:32 2007 +0000
@@ -5128,6 +5128,9 @@
 pidgin_conv_new(PurpleConversation *conv)
 {
 	private_gtkconv_new(conv, FALSE);
+	if (PIDGIN_IS_PIDGIN_CONVERSATION(conv))
+		purple_signal_emit(pidgin_conversations_get_handle(),
+				"conversation-displayed", PIDGIN_CONVERSATION(conv));
 }
 
 static void
--- a/pidgin/gtkconv.h	Sat Oct 06 12:05:22 2007 +0000
+++ b/pidgin/gtkconv.h	Sun Oct 07 10:28:32 2007 +0000
@@ -1,6 +1,7 @@
 /**
  * @file gtkconv.h GTK+ Conversation API
  * @ingroup pidgin
+ * @see @ref gtkconv-signals
  */
 
 /* pidgin
--- a/pidgin/gtkimhtml.h	Sat Oct 06 12:05:22 2007 +0000
+++ b/pidgin/gtkimhtml.h	Sun Oct 07 10:28:32 2007 +0000
@@ -1,6 +1,7 @@
 /**
  * @file gtkimhtml.h GTK+ IM/HTML rendering component
  * @ingroup pidgin
+ * @see @ref gtkimhtml-signals
  */
 
 /* Pidgin is the legal property of its developers, whose names are too numerous
--- a/pidgin/gtklog.h	Sat Oct 06 12:05:22 2007 +0000
+++ b/pidgin/gtklog.h	Sun Oct 07 10:28:32 2007 +0000
@@ -1,6 +1,7 @@
 /**
  * @file gtklog.h GTK+ Log viewer
  * @ingroup pidgin
+ * @see @ref gtklog-signals
  */
 
 /* pidgin
--- a/pidgin/gtkstatusbox.c	Sat Oct 06 12:05:22 2007 +0000
+++ b/pidgin/gtkstatusbox.c	Sun Oct 07 10:28:32 2007 +0000
@@ -1395,7 +1395,7 @@
 		return;
 	}
 	gtk_grab_add (box->popup_window);
-//	box->popup_in_progress = TRUE;
+	/*box->popup_in_progress = TRUE;*/
 	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (box->toggle_button),
 				      TRUE);
 
@@ -1407,7 +1407,8 @@
 }
 
 static void
-pidgin_status_box_popdown(PidginStatusBox *box) {
+pidgin_status_box_popdown(PidginStatusBox *box)
+{
 	gtk_widget_hide(box->popup_window);
 	box->popup_in_progress = FALSE;
 	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (box->toggle_button),
@@ -1415,16 +1416,34 @@
 	gtk_grab_remove (box->popup_window);
 }
 
+static gboolean
+toggle_key_press_cb(GtkWidget *widget, GdkEventKey *event, PidginStatusBox *box)
+{
+	switch (event->keyval) {
+		case GDK_Return:
+		case GDK_KP_Enter:
+		case GDK_KP_Space:
+		case GDK_space:
+			if (!box->popup_in_progress) {
+				pidgin_status_box_popup (box);
+				box->popup_in_progress = TRUE;
+			} else {
+				pidgin_status_box_popdown(box);
+			}
+			return TRUE;
+		default:
+			return TRUE;
+	}
+}
 
-static 
-gboolean
+static gboolean
 toggled_cb(GtkWidget *widget, GdkEventButton *event, PidginStatusBox *box)
 {
-		if (!box->popup_in_progress)
-			pidgin_status_box_popup (box);
-		else
-			pidgin_status_box_popdown(box);
-return TRUE;
+	if (!box->popup_in_progress)
+		pidgin_status_box_popup (box);
+	else
+		pidgin_status_box_popdown(box);
+	return TRUE;
 }
 
 static void
@@ -1775,6 +1794,8 @@
 	g_signal_connect(G_OBJECT(status_box->toggle_button), "button-release-event",
 			 G_CALLBACK(button_released_cb), status_box);
 #endif
+	g_signal_connect(G_OBJECT(status_box->toggle_button), "key-press-event",
+	                 G_CALLBACK(toggle_key_press_cb), status_box);
 	g_signal_connect(G_OBJECT(status_box->toggle_button), "button-press-event",
 	                 G_CALLBACK(toggled_cb), status_box);
 	g_signal_connect(G_OBJECT(buffer), "changed", G_CALLBACK(imhtml_changed_cb), status_box);