pidgin: aefe1131: Use normalized chat names when searching...

sadrul at pidgin.im sadrul at pidgin.im
Fri Nov 14 22:55:22 EST 2008


-----------------------------------------------------------------
Revision: aefe1131c5ad8a76d3d05d8008c2cce739a96cd8
Ancestor: a2e08aeee42341edca8ebca7236372421b315a2e
Author: sadrul at pidgin.im
Date: 2008-11-15T03:53:25
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/aefe1131c5ad8a76d3d05d8008c2cce739a96cd8

Modified files:
        libpurple/blist.c

ChangeLog: 

Use normalized chat names when searching for chats. This fixes an issue
where irc.undernet.org sends the chat-name in uppercase, and screws up
persistent chats. Fixes #5028.

-------------- next part --------------
============================================================
--- libpurple/blist.c	e7c7fb700491e00370bb540d6c04576cb636b72a
+++ libpurple/blist.c	8f1b91cf2a8d7b96138086a2e62a9f63381a31d7
@@ -2214,6 +2214,7 @@ purple_blist_find_chat(PurpleAccount *ac
 	struct proto_chat_entry *pce;
 	PurpleBlistNode *node, *group;
 	GList *parts;
+	char *normname;
 
 	g_return_val_if_fail(purplebuddylist != NULL, NULL);
 	g_return_val_if_fail((name != NULL) && (*name != '\0'), NULL);
@@ -2227,6 +2228,7 @@ purple_blist_find_chat(PurpleAccount *ac
 	if (prpl_info->find_blist_chat != NULL)
 		return prpl_info->find_blist_chat(account, name);
 
+	normname = g_strdup(purple_normalize(account, name));
 	for (group = purplebuddylist->root; group != NULL; group = group->next) {
 		for (node = group->child; node != NULL; node = node->next) {
 			if (PURPLE_BLIST_NODE_IS_CHAT(node)) {
@@ -2246,14 +2248,15 @@ purple_blist_find_chat(PurpleAccount *ac
 				g_list_free(parts);
 
 				if (chat->account == account && chat_name != NULL &&
-					name != NULL && !strcmp(chat_name, name)) {
-
+					normname != NULL && !strcmp(purple_normalize(account, chat_name), normname)) {
+					g_free(normname);
 					return chat;
 				}
 			}
 		}
 	}
 
+	g_free(normname);
 	return NULL;
 }
 


More information about the Commits mailing list