Mercurial > pidgin.yaz
diff libpurple/protocols/jabber/jabber.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 | 5f97830906bc fba8dd643796 |
children | 168fcd171875 |
line wrap: on
line diff
--- a/libpurple/protocols/jabber/jabber.c Sun Sep 20 10:57:21 2009 +0000 +++ b/libpurple/protocols/jabber/jabber.c Sun Sep 20 19:57:21 2009 +0000 @@ -2877,6 +2877,11 @@ { JabberStream *js = conv->account->gc->proto_data; const gchar *who; + gchar *description; + PurpleBuddy *buddy; + const char *alias; + PurpleAttentionType *attn = + purple_get_attention_type_from_code(conv->account, 0); if (!args || !args[0]) { /* use the buddy from conversation, if it's a one-to-one conversation */ @@ -2889,27 +2894,19 @@ who = args[0]; } - if (_jabber_send_buzz(js, who, error)) { - const gchar *alias; - gchar *str; - PurpleBuddy *buddy = - purple_find_buddy(purple_connection_get_account(conv->account->gc), - who); - - if (buddy != NULL) - alias = purple_buddy_get_contact_alias(buddy); - else - alias = who; - - str = g_strdup_printf(_("Buzzing %s..."), alias); - purple_conversation_write(conv, NULL, str, - PURPLE_MESSAGE_SYSTEM|PURPLE_MESSAGE_NOTIFY, time(NULL)); - g_free(str); - - return PURPLE_CMD_RET_OK; - } else { - return PURPLE_CMD_RET_FAILED; - } + buddy = purple_find_buddy(conv->account, who); + if (buddy != NULL) + alias = purple_buddy_get_contact_alias(buddy); + else + alias = who; + + description = + g_strdup_printf(purple_attention_type_get_outgoing_desc(attn), alias); + purple_conversation_attention(conv, who, 0, PURPLE_MESSAGE_SEND, time(NULL)); + purple_conversation_write(conv, NULL, description, + PURPLE_MESSAGE_NOTIFY | PURPLE_MESSAGE_SYSTEM, time(NULL)); + g_free(description); + return _jabber_send_buzz(js, who, error) ? PURPLE_CMD_RET_OK : PURPLE_CMD_RET_FAILED; } GList *jabber_attention_types(PurpleAccount *account)