changeset 29266:008f35e7d538

Use purple_prpl_got_attention
author Marcus Lundblad <ml@update.uu.se>
date Thu, 01 Jan 2009 21:01:42 +0000
parents c0f8b11604c2
children 58e1e1463b6e
files libpurple/protocols/jabber/message.c
diffstat 1 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/message.c	Sun Dec 07 01:41:45 2008 +0000
+++ b/libpurple/protocols/jabber/message.c	Thu Jan 01 21:01:42 2009 +0000
@@ -302,16 +302,16 @@
 	
 	account = purple_connection_get_account(jm->js->gc);
 	
-	if ((buddy = purple_find_buddy(account, jm->from)) != NULL)
-		username = g_markup_escape_text(purple_buddy_get_alias(buddy), -1);
-	else
+	if ((buddy = purple_find_buddy(account, jm->from)) == NULL)
 		return; /* Do not accept buzzes from unknown people */
 
-	c = purple_conversation_new(PURPLE_CONV_TYPE_IM, account, jm->from);
+	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);
 
-	str = g_strdup_printf(_("%s has buzzed you!"), username);
-	
-	purple_conversation_write(c, NULL, str, PURPLE_MESSAGE_SYSTEM|PURPLE_MESSAGE_NOTIFY, time(NULL));
+	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, username, 0);
 	purple_conversation_attention(c, username, 0, PURPLE_MESSAGE_RECV, time(NULL));
 	g_free(username);
 	g_free(str);