changeset 26581:5617edc6c7a5

Set PURPLE_MESSAGE_RECV before receiving-im-msg. Also set it when receiving chat messages.
author Richard Nelson <wabz@pidgin.im>
date Mon, 06 Apr 2009 10:33:28 +0000
parents 246081d2d990
children 8986c3804ada
files libpurple/server.c
diffstat 1 files changed, 11 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/server.c	Mon Apr 06 10:31:17 2009 +0000
+++ b/libpurple/server.c	Mon Apr 06 10:33:28 2009 +0000
@@ -587,6 +587,11 @@
 
 	account  = purple_connection_get_account(gc);
 
+	/*
+	 * XXX: Should we be setting this here, or relying on prpls to set it?
+	 */
+	flags |= PURPLE_MESSAGE_RECV;
+
 	if (PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_prpl(gc))->set_permit_deny == NULL) {
 		/* protocol does not support privacy, handle it ourselves */
 		if (!purple_privacy_check(account, who)) {
@@ -630,11 +635,6 @@
 	if (conv == NULL)
 		conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, name, gc->account);
 
-	/*
-	 * XXX: Should we be setting this here, or relying on prpls to set it?
-	 */
-	flags |= PURPLE_MESSAGE_RECV;
-
 	if (conv == NULL)
 		conv = purple_conversation_new(PURPLE_CONV_TYPE_IM, account, name);
 
@@ -925,6 +925,12 @@
 	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;