diff libpurple/conversation.c @ 25866:1cf0b4f71d16

*** Plucked rev 0257ab6e (wabz@pidgin.im): Set PURPLE_MESSAGE_RECV before receiving-im-msg. Also set it when receiving chat messages. *** Plucked rev eed05980 (wabz@pidgin.im): Set _MESSAGE_{RECV,SEND} properly when receiving chat messages. Thanks Sadrul! *** Plucked rev ec236422 (sadrul@pidgin.im): 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 Wed, 29 Apr 2009 18:19:22 +0000
parents 7f552614ec8a
children 51ff18d00dea
line wrap: on
line diff
--- a/libpurple/conversation.c	Wed Apr 29 00:52:08 2009 +0000
+++ b/libpurple/conversation.c	Wed Apr 29 18:19:22 2009 +0000
@@ -1477,11 +1477,11 @@
 		return;
 
 	if (!(flags & PURPLE_MESSAGE_WHISPER)) {
-		char *str;
-
-		str = g_strdup(purple_normalize(account, who));
-
-		if (!strcmp(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. */