diff libpurple/conversation.c @ 26803:1ba4bbd3b0cd

Chat's nick is normalized. So normalize before comparing with it. Also, remove an extra normalization operation.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Tue, 28 Apr 2009 03:44:26 +0000
parents 15ae2dea92b3
children 2ab648c328cc 684690dbda4a b2b1fa27047a
line wrap: on
line diff
--- a/libpurple/conversation.c	Mon Apr 27 17:49:36 2009 +0000
+++ b/libpurple/conversation.c	Tue Apr 28 03:44:26 2009 +0000
@@ -1477,11 +1477,11 @@
 		return;
 
 	if (!(flags & PURPLE_MESSAGE_WHISPER)) {
-		char *str;
-
-		str = g_strdup(purple_normalize(account, who));
-
-		if (purple_strequal(str, purple_normalize(account, chat->nick))) {
+		const char *str;
+
+		str = purple_normalize(account, who);
+
+		if (purple_strequal(str, chat->nick)) {
 			flags |= PURPLE_MESSAGE_SEND;
 		} else {
 			flags |= PURPLE_MESSAGE_RECV;
@@ -1489,8 +1489,6 @@
 			if (purple_utf8_has_word(message, chat->nick))
 				flags |= PURPLE_MESSAGE_NICK;
 		}
-
-		g_free(str);
 	}
 
 	/* Pass this on to either the ops structure or the default write func. */