Mercurial > pidgin.yaz
diff libpurple/server.c @ 26585:fb44acfae441
Set _MESSAGE_{RECV,SEND} properly when receiving chat messages. Thanks Sadrul!
author | Richard Nelson <wabz@pidgin.im> |
---|---|
date | Mon, 06 Apr 2009 23:05:02 +0000 |
parents | 5617edc6c7a5 |
children | 1ba4bbd3b0cd 1337d2813b2d |
line wrap: on
line diff
--- a/libpurple/server.c Mon Apr 06 13:18:36 2009 +0000 +++ b/libpurple/server.c Mon Apr 06 23:05:02 2009 +0000 @@ -925,12 +925,6 @@ g_return_if_fail(who != NULL); g_return_if_fail(message != NULL); - /* - * XXX: Should we be setting this here, or relying on prpls to set it? - */ - if (g_strcmp0(purple_account_get_username(g->account), who)) - flags |= PURPLE_MESSAGE_RECV; - for (bcs = g->buddy_chats; bcs != NULL; bcs = bcs->next) { conv = (PurpleConversation *)bcs->data; @@ -945,6 +939,14 @@ if (!conv) return; + /* Did I send the message? */ + if (purple_strequal(purple_conv_chat_get_nick(chat), who)) { + flags |= PURPLE_MESSAGE_SEND; + flags &= ~PURPLE_MESSAGE_RECV; /* Just in case some prpl sets it! */ + } else { + flags |= PURPLE_MESSAGE_RECV; + } + /* * Make copies of the message and the sender in case plugins want * to free these strings and replace them with a modifed version.