# HG changeset patch # User Sadrul Habib Chowdhury # Date 1240890266 0 # Node ID 1ba4bbd3b0cd6ac34b75a5ce4403587f9c786be4 # Parent 25e01fe7b732d34b81d7ece08b4c335290aa1f5c Chat's nick is normalized. So normalize before comparing with it. Also, remove an extra normalization operation. diff -r 25e01fe7b732 -r 1ba4bbd3b0cd libpurple/conversation.c --- 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. */ diff -r 25e01fe7b732 -r 1ba4bbd3b0cd libpurple/server.c --- a/libpurple/server.c Mon Apr 27 17:49:36 2009 +0000 +++ b/libpurple/server.c Tue Apr 28 03:44:26 2009 +0000 @@ -940,7 +940,8 @@ return; /* Did I send the message? */ - if (purple_strequal(purple_conv_chat_get_nick(chat), who)) { + if (purple_strequal(purple_conv_chat_get_nick(chat), + purple_normalize(purple_conversation_get_account(conv), who))) { flags |= PURPLE_MESSAGE_SEND; flags &= ~PURPLE_MESSAGE_RECV; /* Just in case some prpl sets it! */ } else {