comparison libpurple/protocols/jabber/message.c @ 29697:40b523845a6e

propagate from branch 'im.pidgin.pidgin' (head 8c322571bfb4f2d00c9126e59746445f877be296) to branch 'im.pidgin.cpw.attention_ui' (head f2b8ccc32a73cb137e1a4f3fd5fb55266df2feed)
author Marcus Lundblad <ml@update.uu.se>
date Tue, 03 Nov 2009 18:27:22 +0000
parents 0645dc6eeed1 168fcd171875
children f85510c955e4
comparison
equal deleted inserted replaced
28865:28d73d34d792 29697:40b523845a6e
292 } 292 }
293 293
294 static void handle_buzz(JabberMessage *jm) { 294 static void handle_buzz(JabberMessage *jm) {
295 PurpleBuddy *buddy; 295 PurpleBuddy *buddy;
296 PurpleAccount *account; 296 PurpleAccount *account;
297 PurpleConversation *c;
298 char *username;
297 299
298 /* Delayed buzz MUST NOT be accepted */ 300 /* Delayed buzz MUST NOT be accepted */
299 if(jm->delayed) 301 if(jm->delayed)
300 return; 302 return;
301 303
306 account = purple_connection_get_account(jm->js->gc); 308 account = purple_connection_get_account(jm->js->gc);
307 309
308 if ((buddy = purple_find_buddy(account, jm->from)) == NULL) 310 if ((buddy = purple_find_buddy(account, jm->from)) == NULL)
309 return; /* Do not accept buzzes from unknown people */ 311 return; /* Do not accept buzzes from unknown people */
310 312
313 c = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, jm->from, account);
314 if (c == NULL)
315 c = purple_conversation_new(PURPLE_CONV_TYPE_IM, account, jm->from);
316
317 username = g_markup_escape_text(purple_buddy_get_alias(buddy), -1);
311 /* xmpp only has 1 attention type, so index is 0 */ 318 /* xmpp only has 1 attention type, so index is 0 */
312 purple_prpl_got_attention(jm->js->gc, jm->from, 0); 319 purple_prpl_got_attention(jm->js->gc, jm->from, 0);
320 purple_conversation_attention(c, jm->from, 0, PURPLE_MESSAGE_RECV, time(NULL));
321
322 g_free(username);
313 } 323 }
314 324
315 /* used internally by the functions below */ 325 /* used internally by the functions below */
316 typedef struct { 326 typedef struct {
317 gchar *cid; 327 gchar *cid;