Mercurial > pidgin.yaz
changeset 29703:974748d0e1f2
jabber: Don't pre-create a conversation on an incoming attention
Prevents a conversation popping up despite "Hide new IM"
author | Marcus Lundblad <ml@update.uu.se> |
---|---|
date | Mon, 16 Nov 2009 19:59:20 +0000 |
parents | 430badc49904 |
children | 9198a5d39c5c |
files | libpurple/protocols/jabber/message.c |
diffstat | 1 files changed, 3 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/protocols/jabber/message.c Mon Nov 16 19:43:36 2009 +0000 +++ b/libpurple/protocols/jabber/message.c Mon Nov 16 19:59:20 2009 +0000 @@ -295,7 +295,6 @@ PurpleBuddy *buddy; PurpleAccount *account; PurpleConversation *c; - char *username; /* Delayed buzz MUST NOT be accepted */ if(jm->delayed) @@ -310,16 +309,11 @@ if ((buddy = purple_find_buddy(account, jm->from)) == NULL) return; /* Do not accept buzzes from unknown people */ - c = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, jm->from, account); - if (c == NULL) - c = purple_conversation_new(PURPLE_CONV_TYPE_IM, account, jm->from); - - username = g_markup_escape_text(purple_buddy_get_alias(buddy), -1); /* xmpp only has 1 attention type, so index is 0 */ purple_prpl_got_attention(jm->js->gc, jm->from, 0); - purple_conversation_attention(c, jm->from, 0, PURPLE_MESSAGE_RECV, time(NULL)); - - g_free(username); + c = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, jm->from, account); + if (c) + purple_conversation_attention(c, jm->from, 0, PURPLE_MESSAGE_RECV, time(NULL)); } /* used internally by the functions below */