diff src/conversation.c @ 4793:677d3cb193a1

[gaim-migrate @ 5113] this removes all the remaining deprecated glib, gdk, gdk-pixbuf, and gtk function calls. Hopefully I didn't break anything. Most of this is due to the deprecation of g_strcasecmp and g_strncasecmp. Two functions I never thought would be deprecated, but apparently they're no good at comparing utf8 text. g_ascii_str{,n}casecmp is OK when you're sure that it's ASCII. Otherwise, we're supposed to use g_utf8_collate(), except that it is case sensitive. Since glib doesn't currently have a case-insensitive one, I wrote one. If you need to compare utf8 text, you can use gaim_utf8_strcasecmp(). I have to go do dishes now. committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Sun, 16 Mar 2003 00:01:49 +0000
parents 283fb289c510
children 1c371e4244d6
line wrap: on
line diff
--- a/src/conversation.c	Sat Mar 15 22:22:39 2003 +0000
+++ b/src/conversation.c	Sun Mar 16 00:01:49 2003 +0000
@@ -88,11 +88,9 @@
 	char *msg, *who, *p;
 	int n;
 
-	msg = g_strdup(message);
-	g_strdown(msg);
-
-	who = g_strdup(gc->username);
-	g_strdown(who);
+	msg = g_utf8_strdown(message, -1);
+
+	who = g_utf8_strdown(gc->username, -1);
 	n = strlen(who);
 
 	if ((p = strstr(msg, who)) != NULL) {
@@ -106,14 +104,13 @@
 
 	g_free(who);
 
-	if (!g_strcasecmp(gc->username, gc->displayname)) {
+	if (!gaim_utf8_strcasecmp(gc->username, gc->displayname)) {
 		g_free(msg);
 
 		return FALSE;
 	}
 
-	who = g_strdup(gc->displayname);
-	g_strdown(who);
+	who = g_utf8_strdown(gc->displayname, -1);
 	n = strlen(who);
 
 	if (n > 0 && (p = strstr(msg, who)) != NULL) {
@@ -1342,7 +1339,7 @@
 	for (cnv = gaim_get_conversations(); cnv != NULL; cnv = cnv->next) {
 		c = (struct gaim_conversation *)cnv->data;
 
-		if (!g_strcasecmp(cuser, normalize(gaim_conversation_get_name(c))))
+		if (!gaim_utf8_strcasecmp(cuser, normalize(gaim_conversation_get_name(c))))
 			break;
 
 		c = NULL;
@@ -1368,7 +1365,7 @@
 	for (cnv = gaim_get_conversations(); cnv != NULL; cnv = cnv->next) {
 		c = (struct gaim_conversation *)cnv->data;
 
-		if (!g_strcasecmp(cuser, normalize(gaim_conversation_get_name(c))) &&
+		if (!gaim_utf8_strcasecmp(cuser, normalize(gaim_conversation_get_name(c))) &&
 			account == gaim_conversation_get_account(c)) {
 
 			break;
@@ -1780,15 +1777,15 @@
 
 		const char *ign = (const char *)ignored->data;
 
-		if (!g_strcasecmp(user, ign) ||
-			((*ign == '+' || *ign == '%') && !g_strcasecmp(user, ign + 1)))
+		if (!gaim_utf8_strcasecmp(user, ign) ||
+			((*ign == '+' || *ign == '%') && !gaim_utf8_strcasecmp(user, ign + 1)))
 			return ign;
 
 		if (*ign == '@') {
 			ign++;
 
-			if ((*ign == '+' && !g_strcasecmp(user, ign + 1)) ||
-				(*ign != '+' && !g_strcasecmp(user, ign)))
+			if ((*ign == '+' && !gaim_utf8_strcasecmp(user, ign + 1)) ||
+				(*ign != '+' && !gaim_utf8_strcasecmp(user, ign)))
 				return ign;
 		}
 	}
@@ -1874,8 +1871,8 @@
 
 		str = g_strdup(normalize(who));
 
-		if (!g_strcasecmp(str, normalize(gc->username)) ||
-			!g_strcasecmp(str, normalize(gc->displayname))) {
+		if (!gaim_utf8_strcasecmp(str, normalize(gc->username)) ||
+			!gaim_utf8_strcasecmp(str, normalize(gc->displayname))) {
 
 			flags |= WFLAG_SEND;
 		}
@@ -1968,7 +1965,7 @@
 		 names != NULL;
 		 names = names->next) {
 
-		if (!g_strcasecmp((char *)names->data, old_user)) {
+		if (!gaim_utf8_strcasecmp((char *)names->data, old_user)) {
 			gaim_chat_set_users(chat,
 					g_list_remove(gaim_chat_get_users(chat), names->data));
 			break;
@@ -2015,7 +2012,7 @@
 		 names != NULL;
 		 names = names->next) {
 
-		if (!g_strcasecmp((char *)names->data, user)) {
+		if (!gaim_utf8_strcasecmp((char *)names->data, user)) {
 			gaim_chat_set_users(chat,
 					g_list_remove(gaim_chat_get_users(chat), names->data));
 			break;