Mercurial > pidgin
comparison libpurple/protocols/jabber/message.c @ 29282:ae24e54a5014
propagate from branch 'im.pidgin.pidgin' (head 1890ad1259c93f5ad18ceb3365717ebc43b30198)
to branch 'im.pidgin.cpw.attention_ui' (head b3be679bb2671eeaa83aae11c9d39e209f999b5d)
author | Marcus Lundblad <ml@update.uu.se> |
---|---|
date | Sat, 04 Apr 2009 10:51:12 +0000 |
parents | 5640246d96c1 |
children | 676494d92262 |
comparison
equal
deleted
inserted
replaced
26429:f171707b7d54 | 29282:ae24e54a5014 |
---|---|
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; |