libpurple/protocols/jabber/message.c

branch
cpw.attention_ui
changeset 26730
324970a6b271
parent 26687
1e799151fabe
parent 26049
a980de7984e8
child 26837
2c3279eb393d
--- a/libpurple/protocols/jabber/message.c	Tue Apr 07 05:28:58 2009 +0000
+++ b/libpurple/protocols/jabber/message.c	Tue Apr 07 08:12:56 2009 +0000
@@ -289,6 +289,8 @@
 static void handle_buzz(JabberMessage *jm) {
 	PurpleBuddy *buddy;
 	PurpleAccount *account;
+	PurpleConversation *c;
+	char *username;
 
 	/* Delayed buzz MUST NOT be accepted */
 	if(jm->delayed)
@@ -303,8 +305,16 @@
 	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);
 }
 
 /* used internally by the functions below */

mercurial