changeset 14930:ad64947f81c8

[gaim-migrate @ 17702] Casefold the alias before generating the collation key. This should retain the previous behavior (though maybe the corner case of two nicks that differ only by case will be non-deterministic) while still using strcmp() as documented. committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Wed, 08 Nov 2006 04:16:56 +0000
parents 8d0b9a5b1146
children d7732681329b
files gtk/gtkconv.c
diffstat 1 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/gtk/gtkconv.c	Wed Nov 08 04:15:15 2006 +0000
+++ b/gtk/gtkconv.c	Wed Nov 08 04:16:56 2006 +0000
@@ -3401,7 +3401,7 @@
 	GtkTreeIter iter;
 	gboolean is_me = FALSE;
 	gboolean is_buddy;
-	gchar *alias_key, *name, *alias;
+	gchar *tmp, *alias_key, *name, *alias;
 	int flags;
 
 	alias = cb->alias;
@@ -3425,7 +3425,9 @@
 
 	is_buddy = (gaim_find_buddy(conv->account, name) != NULL);
 
-	alias_key = g_utf8_collate_key(alias, strlen(alias));
+	tmp = g_utf8_casefold(alias, -1);
+	alias_key = g_utf8_collate_key(tmp, -1);
+	g_free(tmp);
 
 	if (is_me)
 	{
@@ -3802,6 +3804,7 @@
 
 		if (!strcmp(normalized_name, gaim_normalize(conv->account, name))) {
 			const char *alias = name;
+			char *tmp;
 			char *alias_key = NULL;
 			GaimBuddy *buddy2;
 
@@ -3812,7 +3815,9 @@
 					alias = gaim_buddy_get_contact_alias(buddy2);
 				}
 
-				alias_key = g_utf8_collate_key(alias, strlen(alias));
+				tmp = g_utf8_casefold(alias, -1);
+				alias_key = g_utf8_collate_key(tmp, -1);
+				g_free(tmp);
 
 				gtk_list_store_set(GTK_LIST_STORE(model), &iter,
 								CHAT_USERS_ALIAS_COLUMN, alias,