Mercurial > pidgin
comparison libpurple/protocols/jabber/message.c @ 29284:676494d92262
propagate from branch 'im.pidgin.pidgin' (head 5ab68ddb0251205f7ef97f4c280e65696cbd5ff2)
to branch 'im.pidgin.cpw.attention_ui' (head f244d5d303fff82243cee52fe1794b9338ec4d16)
author | Marcus Lundblad <ml@update.uu.se> |
---|---|
date | Tue, 07 Apr 2009 08:12:56 +0000 |
parents | ae41d8e827e3 5640246d96c1 |
children | ce876e58cf6a |
comparison
equal
deleted
inserted
replaced
26506:1a94a964bddf | 29284:676494d92262 |
---|---|
287 } | 287 } |
288 | 288 |
289 static void handle_buzz(JabberMessage *jm) { | 289 static void handle_buzz(JabberMessage *jm) { |
290 PurpleBuddy *buddy; | 290 PurpleBuddy *buddy; |
291 PurpleAccount *account; | 291 PurpleAccount *account; |
292 PurpleConversation *c; | |
293 char *username; | |
292 | 294 |
293 /* Delayed buzz MUST NOT be accepted */ | 295 /* Delayed buzz MUST NOT be accepted */ |
294 if(jm->delayed) | 296 if(jm->delayed) |
295 return; | 297 return; |
296 | 298 |
301 account = purple_connection_get_account(jm->js->gc); | 303 account = purple_connection_get_account(jm->js->gc); |
302 | 304 |
303 if ((buddy = purple_find_buddy(account, jm->from)) == NULL) | 305 if ((buddy = purple_find_buddy(account, jm->from)) == NULL) |
304 return; /* Do not accept buzzes from unknown people */ | 306 return; /* Do not accept buzzes from unknown people */ |
305 | 307 |
308 c = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, jm->from, account); | |
309 if (c == NULL) | |
310 c = purple_conversation_new(PURPLE_CONV_TYPE_IM, account, jm->from); | |
311 | |
312 username = g_markup_escape_text(purple_buddy_get_alias(buddy), -1); | |
306 /* xmpp only has 1 attention type, so index is 0 */ | 313 /* xmpp only has 1 attention type, so index is 0 */ |
307 purple_prpl_got_attention(jm->js->gc, jm->from, 0); | 314 purple_prpl_got_attention(jm->js->gc, jm->from, 0); |
315 purple_conversation_attention(c, jm->from, 0, PURPLE_MESSAGE_RECV, time(NULL)); | |
316 | |
317 g_free(username); | |
308 } | 318 } |
309 | 319 |
310 /* used internally by the functions below */ | 320 /* used internally by the functions below */ |
311 typedef struct { | 321 typedef struct { |
312 gchar *cid; | 322 gchar *cid; |