changeset 10167:cf45c2a6a7cf

[gaim-migrate @ 11254] Some stuff - fix a crash removing chats from the buddy list, escape aliases in buddy pounce popups and the state notifications from the state notify plugin, and fix a corner-case crash in smiley theme sorting. committer: Tailor Script <tailor@pidgin.im>
author Stu Tomlinson <stu@nosnilmot.com>
date Wed, 10 Nov 2004 17:08:32 +0000
parents 72c9e9bb2c19
children e6372844a4b8
files plugins/statenotify.c src/gtkdialogs.c src/gtkpounce.c src/gtkprefs.c
diffstat 4 files changed, 21 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/statenotify.c	Tue Nov 09 05:48:26 2004 +0000
+++ b/plugins/statenotify.c	Wed Nov 10 17:08:32 2004 +0000
@@ -18,6 +18,7 @@
 	GaimConversation *conv;
 	const char *who;
 	char buf[256];
+	char *escaped;
 
 	conv = gaim_find_conversation_with_account(buddy->name, buddy->account);
 
@@ -25,8 +26,10 @@
 		return;
 
 	who = gaim_buddy_get_alias(buddy);
+	escaped = g_markup_escape_text(who, -1);
 
-	g_snprintf(buf, sizeof(buf), message, who);
+	g_snprintf(buf, sizeof(buf), message, escaped);
+	g_free(escaped);
 
 	gaim_conversation_write(conv, NULL, buf, GAIM_MESSAGE_SYSTEM, time(NULL));
 }
--- a/src/gtkdialogs.c	Tue Nov 09 05:48:26 2004 +0000
+++ b/src/gtkdialogs.c	Wed Nov 10 17:08:32 2004 +0000
@@ -870,15 +870,18 @@
 gaim_gtkdialogs_remove_chat_cb(GaimChat *chat)
 {
 	char *name = NULL;
+	GaimAccount *account;
 	GaimConversation *conv = NULL;
 
-	if (GAIM_PLUGIN_PROTOCOL_INFO(chat->account->gc->prpl)->get_chat_name != NULL)
-		name = GAIM_PLUGIN_PROTOCOL_INFO(chat->account->gc->prpl)->get_chat_name(chat->components);
+	account = chat->account;
+
+	if (GAIM_PLUGIN_PROTOCOL_INFO(account->gc->prpl)->get_chat_name != NULL)
+		name = GAIM_PLUGIN_PROTOCOL_INFO(account->gc->prpl)->get_chat_name(chat->components);
 
 	gaim_blist_remove_chat(chat);
 
 	if (name != NULL) {
-		conv = gaim_find_conversation_with_account(name, chat->account);
+		conv = gaim_find_conversation_with_account(name, account);
 		g_free(name);
 	}
 
--- a/src/gtkpounce.c	Tue Nov 09 05:48:26 2004 +0000
+++ b/src/gtkpounce.c	Wed Nov 10 17:08:32 2004 +0000
@@ -949,6 +949,9 @@
 	{
 		char tmp[1024];
 		const char *name_shown;
+		char *escaped;
+
+		escaped = g_markup_escape_text(alias, -1);
 
 		/*
 		 * Here we place the protocol name in the pounce dialog to lessen
@@ -972,7 +975,9 @@
 				   (events & GAIM_POUNCE_AWAY) ?
 				   _("%s has gone away. (%s)") :
 				   _("Unknown pounce event. Please report this!"),
-				   alias, gaim_account_get_protocol_name(account));
+				   escaped, gaim_account_get_protocol_name(account));
+
+		g_free(escaped);
 
 		/*
 		 * Ok here is where I change the second argument, title, from
--- a/src/gtkprefs.c	Tue Nov 09 05:48:26 2004 +0000
+++ b/src/gtkprefs.c	Wed Nov 10 17:08:32 2004 +0000
@@ -608,8 +608,11 @@
 		if (!(name1 == NULL && name2 == NULL))
 			ret = (name1 == NULL) ? -1: 1;
 	} else if (!g_ascii_strcasecmp(name1, "none")) {
-		/* Sort name1 first */
-		ret = -1;
+		if (!g_utf8_collate(name1, name2))
+			ret = 0;
+		else
+			/* Sort name1 first */
+			ret = -1;
 	} else if (!g_ascii_strcasecmp(name2, "none")) {
 		/* Sort name2 first */
 		ret = 1;