Mercurial > pidgin.yaz
comparison libpurple/protocols/jabber/message.c @ 29682:b2b1fa27047a
propagate from branch 'im.pidgin.pidgin' (head 13ac492a493b4d31c8b29905174b43a533304300)
to branch 'im.pidgin.cpw.attention_ui' (head 347126c6f7434b4777f4fdc28ea1c8f796fe707e)
author | Marcus Lundblad <ml@update.uu.se> |
---|---|
date | Sat, 02 May 2009 06:39:51 +0000 |
parents | 3912f55a1633 4548c114e953 |
children | 45795fd9c0a9 |
comparison
equal
deleted
inserted
replaced
26836:836a36564ff5 | 29682:b2b1fa27047a |
---|---|
288 } | 288 } |
289 | 289 |
290 static void handle_buzz(JabberMessage *jm) { | 290 static void handle_buzz(JabberMessage *jm) { |
291 PurpleBuddy *buddy; | 291 PurpleBuddy *buddy; |
292 PurpleAccount *account; | 292 PurpleAccount *account; |
293 PurpleConversation *c; | |
294 char *username; | |
293 | 295 |
294 /* Delayed buzz MUST NOT be accepted */ | 296 /* Delayed buzz MUST NOT be accepted */ |
295 if(jm->delayed) | 297 if(jm->delayed) |
296 return; | 298 return; |
297 | 299 |
302 account = purple_connection_get_account(jm->js->gc); | 304 account = purple_connection_get_account(jm->js->gc); |
303 | 305 |
304 if ((buddy = purple_find_buddy(account, jm->from)) == NULL) | 306 if ((buddy = purple_find_buddy(account, jm->from)) == NULL) |
305 return; /* Do not accept buzzes from unknown people */ | 307 return; /* Do not accept buzzes from unknown people */ |
306 | 308 |
309 c = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, jm->from, account); | |
310 if (c == NULL) | |
311 c = purple_conversation_new(PURPLE_CONV_TYPE_IM, account, jm->from); | |
312 | |
313 username = g_markup_escape_text(purple_buddy_get_alias(buddy), -1); | |
307 /* xmpp only has 1 attention type, so index is 0 */ | 314 /* xmpp only has 1 attention type, so index is 0 */ |
308 purple_prpl_got_attention(jm->js->gc, jm->from, 0); | 315 purple_prpl_got_attention(jm->js->gc, jm->from, 0); |
316 purple_conversation_attention(c, jm->from, 0, PURPLE_MESSAGE_RECV, time(NULL)); | |
317 | |
318 g_free(username); | |
309 } | 319 } |
310 | 320 |
311 /* used internally by the functions below */ | 321 /* used internally by the functions below */ |
312 typedef struct { | 322 typedef struct { |
313 gchar *cid; | 323 gchar *cid; |