comparison libpurple/protocols/jabber/message.c @ 29695:b1284d63b969

propagate from branch 'im.pidgin.pidgin' (head 29f6b9d81574bfa9235dbd438a8934f06552e368) to branch 'im.pidgin.cpw.attention_ui' (head 382194d06f05cbf5030ec6471a719e32bf6ef9d7)
author Marcus Lundblad <ml@update.uu.se>
date Sun, 20 Sep 2009 19:57:21 +0000
parents e8717ca47d25 fba8dd643796
children 168fcd171875
comparison
equal deleted inserted replaced
28646:5f97830906bc 29695:b1284d63b969
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;