# HG changeset patch # User Luke Schierer # Date 1190379381 0 # Node ID 2f1c4b2716ea90fe0a7c085b3da28dd0bcf40a08 # Parent 01e82c562e59756b72284bb53495bae738a64937# Parent b6a01d947a8a9dbb8dcd2b90198077c92be2e470 merge of '2bc502ae06ff6db803c8fe3bd64f1d4cbb88e13f' and 'b23d40378bee58e6e5a79f04f532b50daf43f802' diff -r 01e82c562e59 -r 2f1c4b2716ea ChangeLog --- a/ChangeLog Thu Sep 20 18:59:34 2007 +0000 +++ b/ChangeLog Fri Sep 21 12:56:21 2007 +0000 @@ -34,6 +34,7 @@ * Pidgin's display is now saved with the command line for session restoration. (David Mohr) * You should no longer lose proxy settings when Pidgin is restarted. + * ICQ Birthday notifications are shown as buddy list emblems Version 2.2.0 (09/13/2007): http://developer.pidgin.im/query?status=closed&milestone=2.2.0 diff -r 01e82c562e59 -r 2f1c4b2716ea libpurple/ft.c --- a/libpurple/ft.c Thu Sep 20 18:59:34 2007 +0000 +++ b/libpurple/ft.c Fri Sep 21 12:56:21 2007 +0000 @@ -67,6 +67,7 @@ xfer->ui_ops = purple_xfers_get_ui_ops(); xfer->message = NULL; xfer->current_buffer_size = FT_INITIAL_BUFFER_SIZE; + xfer->fd = -1; ui_ops = purple_xfer_get_ui_ops(xfer); diff -r 01e82c562e59 -r 2f1c4b2716ea libpurple/notify.c --- a/libpurple/notify.c Thu Sep 20 18:59:34 2007 +0000 +++ b/libpurple/notify.c Fri Sep 21 12:56:21 2007 +0000 @@ -150,8 +150,6 @@ { PurpleNotifyUiOps *ops; - g_return_val_if_fail(count != 0, NULL); - if (count == 1) { return purple_notify_email(handle, (subjects == NULL ? NULL : *subjects), @@ -506,7 +504,7 @@ g_return_if_fail(user_info_entry != NULL); g_free(user_info_entry->label); - g_free(user_info_entry->value); + g_free(user_info_entry->value); PURPLE_DBUS_UNREGISTER_POINTER(user_info_entry); g_free(user_info_entry); } @@ -568,7 +566,7 @@ if (user_info_entry->label && user_info_entry->value) g_string_append(text, ": "); if (user_info_entry->value) - g_string_append(text, user_info_entry->value); + g_string_append(text, user_info_entry->value); /* Display a section break as a horizontal line */ if (user_info_entry->type == PURPLE_NOTIFY_USER_INFO_ENTRY_SECTION_BREAK) diff -r 01e82c562e59 -r 2f1c4b2716ea libpurple/protocols/jabber/buddy.c --- a/libpurple/protocols/jabber/buddy.c Thu Sep 20 18:59:34 2007 +0000 +++ b/libpurple/protocols/jabber/buddy.c Fri Sep 21 12:56:21 2007 +0000 @@ -1656,8 +1656,10 @@ if(!strcmp(ns, "jabber:iq:last")) { if(!strcmp(jbr->client.name, "Trillian")) { - if(!strcmp(jbr->client.version, "3.1.0.121")) { - /* verified by nwalp 2007/05/09 */ + /* verified by nwalp 2007/05/09 */ + if(!strcmp(jbr->client.version, "3.1.0.121") || + /* verified by nwalp 2007/09/19 */ + !strcmp(jbr->client.version, "3.1.7.0")) { return TRUE; } } diff -r 01e82c562e59 -r 2f1c4b2716ea libpurple/protocols/jabber/google.c --- a/libpurple/protocols/jabber/google.c Thu Sep 20 18:59:34 2007 +0000 +++ b/libpurple/protocols/jabber/google.c Fri Sep 21 12:56:21 2007 +0000 @@ -61,14 +61,9 @@ to = xmlnode_get_attrib(packet, "to"); default_tos[0] = jabber_get_bare_jid(to); - if (count == 0) { - purple_notify_emails(js->gc, count, FALSE, NULL, NULL, (const char**) default_tos, NULL, NULL, NULL); - g_free(default_tos[0]); - return; - } + message = xmlnode_get_child(child, "mail-thread-info"); - message = xmlnode_get_child(child, "mail-thread-info"); - if (!message) { + if (count == 0 || !message) { purple_notify_emails(js->gc, count, FALSE, NULL, NULL, (const char**) default_tos, NULL, NULL, NULL); g_free(default_tos[0]); return; @@ -127,7 +122,7 @@ if (i>0) purple_notify_emails(js->gc, count, count == i, (const char**) subjects, froms, tos, urls, NULL, NULL); - else + else purple_notify_emails(js->gc, count, FALSE, NULL, NULL, (const char**) default_tos, NULL, NULL, NULL); @@ -257,7 +252,8 @@ if (grt && (*grt == 'H' || *grt == 'h')) { PurpleBuddy *buddy = purple_find_buddy(account, jid_norm); - purple_blist_remove_buddy(buddy); + if (buddy) + purple_blist_remove_buddy(buddy); g_free(jid_norm); return FALSE; } diff -r 01e82c562e59 -r 2f1c4b2716ea libpurple/protocols/jabber/iq.c --- a/libpurple/protocols/jabber/iq.c Thu Sep 20 18:59:34 2007 +0000 +++ b/libpurple/protocols/jabber/iq.c Fri Sep 21 12:56:21 2007 +0000 @@ -255,7 +255,7 @@ if(type && !strcmp(type, "get")) { GHashTable *ui_info; const char *ui_name = NULL, *ui_version = NULL; - +#if 0 if(!purple_prefs_get_bool("/plugins/prpl/jabber/hide_os")) { struct utsname osinfo; @@ -263,7 +263,7 @@ os = g_strdup_printf("%s %s %s", osinfo.sysname, osinfo.release, osinfo.machine); } - +#endif from = xmlnode_get_attrib(packet, "from"); id = xmlnode_get_attrib(packet, "id"); diff -r 01e82c562e59 -r 2f1c4b2716ea libpurple/protocols/msn/session.c --- a/libpurple/protocols/msn/session.c Thu Sep 20 18:59:34 2007 +0000 +++ b/libpurple/protocols/msn/session.c Fri Sep 21 12:56:21 2007 +0000 @@ -269,7 +269,7 @@ /* The core used to use msn_add_buddy to add all buddies before * being logged in. This no longer happens, so we manually iterate - * over the whole buddy list to identify sync issues. + * over the whole buddy list to identify sync issues. */ for (gnode = purple_get_blist()->root; gnode; gnode = gnode->next) { PurpleGroup *group = (PurpleGroup *)gnode; @@ -342,6 +342,8 @@ case MSN_ERROR_SIGN_OTHER: gc->wants_to_die = TRUE; msg = g_strdup(_("You have signed on from another location.")); + if (!purple_account_get_remember_password(session->account)) + purple_account_set_password(session->account, NULL); break; case MSN_ERROR_SERV_UNAVAILABLE: msg = g_strdup(_("The MSN servers are temporarily " diff -r 01e82c562e59 -r 2f1c4b2716ea libpurple/protocols/myspace/myspace.c --- a/libpurple/protocols/myspace/myspace.c Thu Sep 20 18:59:34 2007 +0000 +++ b/libpurple/protocols/myspace/myspace.c Fri Sep 21 12:56:21 2007 +0000 @@ -1784,11 +1784,13 @@ /* Destroy session if fatal. */ if (msim_msg_get(msg, "fatal")) { purple_debug_info("msim", "fatal error, closing\n"); - if (err == 260) { - /* Incorrect password */ - session->gc->wants_to_die = TRUE; - if (!purple_account_get_remember_password(session->account)) - purple_account_set_password(session->account, NULL); + switch (err) { + case 260: /* Incorrect password */ + case 6: /* Logged in elsewhere */ + session->gc->wants_to_die = TRUE; + if (!purple_account_get_remember_password(session->account)) + purple_account_set_password(session->account, NULL); + break; } purple_connection_error(session->gc, full_errmsg); } else { diff -r 01e82c562e59 -r 2f1c4b2716ea libpurple/protocols/novell/novell.c --- a/libpurple/protocols/novell/novell.c Thu Sep 20 18:59:34 2007 +0000 +++ b/libpurple/protocols/novell/novell.c Fri Sep 21 12:56:21 2007 +0000 @@ -130,6 +130,8 @@ if (ret_code == NMERR_AUTHENTICATION_FAILED || ret_code == NMERR_CREDENTIALS_MISSING || ret_code == NMERR_PASSWORD_INVALID) { + if (!purple_account_get_remember_password(gc->account)) + purple_account_set_password(gc->account, NULL); gc->wants_to_die = TRUE; } purple_connection_error(gc, err); @@ -2004,11 +2006,14 @@ _evt_user_disconnect(NMUser * user, NMEvent * event) { PurpleConnection *gc; - - gc = purple_account_get_connection((PurpleAccount *) user->client_data); + PurpleAccount *account = user->client_data; + + gc = purple_account_get_connection(account); if (gc) { gc->wants_to_die = TRUE; /* we don't want to reconnect in this case */ + if (!purple_account_get_remember_password(account)) + purple_account_set_password(account, NULL); purple_connection_error(gc, _("You have been logged out because you" " logged in at another workstation.")); } @@ -2799,7 +2804,7 @@ const char *text = NULL; if (buddy == NULL) - return; + return; gc = purple_account_get_connection(buddy->account); if (gc == NULL || (user = gc->proto_data) == NULL) diff -r 01e82c562e59 -r 2f1c4b2716ea libpurple/protocols/oscar/flap_connection.c --- a/libpurple/protocols/oscar/flap_connection.c Thu Sep 20 18:59:34 2007 +0000 +++ b/libpurple/protocols/oscar/flap_connection.c Fri Sep 21 12:56:21 2007 +0000 @@ -382,6 +382,8 @@ gchar *tmp; if (conn->disconnect_code == 0x0001) { tmp = g_strdup(_("You have signed on from another location.")); + if (!purple_account_get_remember_password(account)) + purple_account_set_password(account, NULL); od->gc->wants_to_die = TRUE; } else if (conn->disconnect_reason == OSCAR_DISCONNECT_REMOTE_CLOSED) tmp = g_strdup(_("Server closed the connection.")); diff -r 01e82c562e59 -r 2f1c4b2716ea libpurple/protocols/oscar/oscar.c --- a/libpurple/protocols/oscar/oscar.c Thu Sep 20 18:59:34 2007 +0000 +++ b/libpurple/protocols/oscar/oscar.c Fri Sep 21 12:56:21 2007 +0000 @@ -5507,6 +5507,8 @@ return "hiptop"; if (userinfo->capabilities & OSCAR_CAPABILITY_SECUREIM) return "secure"; + if (userinfo->icqinfo.status & AIM_ICQ_STATE_BIRTHDAY) + return "birthday"; } return NULL; } diff -r 01e82c562e59 -r 2f1c4b2716ea libpurple/protocols/qq/login_logout.c --- a/libpurple/protocols/qq/login_logout.c Thu Sep 20 18:59:34 2007 +0000 +++ b/libpurple/protocols/qq/login_logout.c Fri Sep 21 12:56:21 2007 +0000 @@ -480,6 +480,8 @@ switch (ret) { case QQ_LOGIN_REPLY_PWD_ERROR: gc->wants_to_die = TRUE; + if (!purple_account_get_remember_password(gc->account)) + purple_account_set_password(gc->account, NULL); purple_connection_error(gc, _("Incorrect password.")); break; case QQ_LOGIN_REPLY_MISC_ERROR: diff -r 01e82c562e59 -r 2f1c4b2716ea libpurple/protocols/simple/simple.c --- a/libpurple/protocols/simple/simple.c Thu Sep 20 18:59:34 2007 +0000 +++ b/libpurple/protocols/simple/simple.c Fri Sep 21 12:56:21 2007 +0000 @@ -695,7 +695,7 @@ static void do_register_exp(struct simple_account_data *sip, int expire) { char *uri, *to, *contact, *hdr; - /* Set our default expiration to 900, + /* Set our default expiration to 900, * as done in the initialization of the simple_account_data * structure. */ @@ -1042,6 +1042,8 @@ if(sip->registrar.retries > SIMPLE_REGISTER_RETRY_MAX) { purple_debug_info("simple", "Setting wants_to_die to true.\n"); sip->gc->wants_to_die = TRUE; + if (!purple_account_get_remember_password(sip->gc->account)) + purple_account_set_password(sip->gc->account, NULL); purple_connection_error(sip->gc, _("Incorrect password.")); return TRUE; } diff -r 01e82c562e59 -r 2f1c4b2716ea libpurple/protocols/yahoo/yahoo.c --- a/libpurple/protocols/yahoo/yahoo.c Thu Sep 20 18:59:34 2007 +0000 +++ b/libpurple/protocols/yahoo/yahoo.c Fri Sep 21 12:56:21 2007 +0000 @@ -202,6 +202,8 @@ if (pkt->service == YAHOO_SERVICE_LOGOFF && pkt->status == -1) { gc->wants_to_die = TRUE; + if (!purple_account_get_remember_password(account)) + purple_account_set_password(account, NULL); purple_connection_error(gc, _("You have signed on from another location.")); return; } @@ -4087,12 +4089,12 @@ { return TRUE; } - + gboolean yahoo_send_attention(PurpleConnection *gc, const char *username, guint type) { PurpleConversation *c; - c = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, + c = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, username, gc->account); g_return_val_if_fail(c != NULL, FALSE); @@ -4117,7 +4119,7 @@ attn->incoming_description = _("%s has buzzed you!"); attn->outgoing_description = _("Buzzing %s..."); list = g_list_append(list, attn); - } + } return list; } diff -r 01e82c562e59 -r 2f1c4b2716ea libpurple/protocols/yahoo/yahoo_aliases.c --- a/libpurple/protocols/yahoo/yahoo_aliases.c Thu Sep 20 18:59:34 2007 +0000 +++ b/libpurple/protocols/yahoo/yahoo_aliases.c Fri Sep 21 12:56:21 2007 +0000 @@ -45,7 +45,7 @@ */ struct callback_data { PurpleConnection *gc; - const char *id; + char *id; }; @@ -56,11 +56,16 @@ static void yahoo_fetch_aliases_cb(PurpleUtilFetchUrlData *url_data, gpointer user_data,const gchar *url_text, size_t len, const gchar *error_message) { + struct callback_data *cb = user_data; + PurpleConnection *gc = cb->gc; + struct yahoo_data *yd = gc->proto_data; + + yd->url_datas = g_slist_remove(yd->url_datas, url_data); + if (len == 0) { purple_debug_info("yahoo","No Aliases to process\n"); } else { const char *yid, *full_name, *nick_name, *alias, *id, *fn, *ln, *nn; - struct callback_data *cb = user_data; PurpleBuddy *b = NULL; xmlnode *item, *contacts; @@ -123,8 +128,9 @@ } } xmlnode_free(contacts); - g_free(cb); } + g_free(cb->id); + g_free(cb); } void @@ -134,6 +140,7 @@ struct callback_data *cb; char *url, *request, *webpage, *webaddress, *strtmp; int inttmp; + PurpleUtilFetchUrlData *url_data; /* Using callback_data so I have access to gc in the callback function */ cb = g_new0(struct callback_data, 1); @@ -150,7 +157,12 @@ webpage, yd->cookie_t,yd->cookie_y, webaddress); /* We have a URL and some header information, let's connect and get some aliases */ - purple_util_fetch_url_request(url, FALSE, NULL, TRUE, request, FALSE, yahoo_fetch_aliases_cb, cb); + url_data = purple_util_fetch_url_request(url, FALSE, NULL, TRUE, request, FALSE, yahoo_fetch_aliases_cb, cb); + if (url_data != NULL) { + yd->url_datas = g_slist_prepend(yd->url_datas, url_data); + } else { + g_free(cb); + } g_free(url); g_free(request); @@ -165,6 +177,11 @@ { xmlnode *node, *result; struct callback_data *cb = user_data; + PurpleConnection *gc = cb->gc; + struct yahoo_data *yd; + + yd = gc->proto_data; + yd->url_datas = g_slist_remove(yd->url_datas, url_data); result = xmlnode_from_str(url_text, -1); @@ -184,6 +201,7 @@ purple_debug_info("yahoo", "Alias update failed (No contact record returned)\n"); } + g_free(cb->id); g_free(cb); xmlnode_free(result); } @@ -197,6 +215,7 @@ int inttmp; struct callback_data *cb; PurpleBuddy *buddy; + PurpleUtilFetchUrlData *url_data; g_return_if_fail(alias!= NULL); g_return_if_fail(who!=NULL); @@ -216,6 +235,7 @@ /* Using callback_data so I have access to gc in the callback function */ cb = g_new0(struct callback_data, 1); cb->id = g_strdup(yu->id); + cb->gc = gc; /* Build all the info to make the web request */ url = g_strdup(YAHOO_ALIAS_UPDATE_URL); @@ -236,7 +256,13 @@ strlen(content), content); /* We have a URL and some header information, let's connect and update the alias */ - purple_util_fetch_url_request(url, FALSE, NULL, TRUE, request, FALSE, yahoo_update_alias_cb, cb); + url_data = purple_util_fetch_url_request(url, FALSE, NULL, TRUE, request, FALSE, yahoo_update_alias_cb, cb); + if (url_data != NULL) { + yd->url_datas = g_slist_prepend(yd->url_datas, url_data); + } else { + g_free(cb->id); + g_free(cb); + } g_free(content); g_free(url); diff -r 01e82c562e59 -r 2f1c4b2716ea libpurple/prpl.c --- a/libpurple/prpl.c Thu Sep 20 18:59:34 2007 +0000 +++ b/libpurple/prpl.c Fri Sep 21 12:56:21 2007 +0000 @@ -226,6 +226,9 @@ { if (!purple_account_is_disconnected(account)) purple_account_disconnect(account); + /* Clear out the unsaved password if we're already disconnected and we switch to offline status */ + else if (!purple_account_get_remember_password(account)) + purple_account_set_password(account, NULL); return; } diff -r 01e82c562e59 -r 2f1c4b2716ea libpurple/util.c --- a/libpurple/util.c Thu Sep 20 18:59:34 2007 +0000 +++ b/libpurple/util.c Fri Sep 21 12:56:21 2007 +0000 @@ -1526,7 +1526,8 @@ while(*p && *p != '>') { if(!g_ascii_strncasecmp(p, "href=", strlen("href="))) { const char *q = p + strlen("href="); - g_string_free(url, TRUE); + if (url) + g_string_free(url, TRUE); url = g_string_new(""); cdata = g_string_new(""); if(*q == '\'' || *q == '\"') @@ -3853,6 +3854,7 @@ gfud->full = full; gfud->request = g_strdup(request); gfud->include_headers = include_headers; + gfud->fd = -1; purple_url_parse(url, &gfud->website.address, &gfud->website.port, &gfud->website.page, &gfud->website.user, &gfud->website.passwd); diff -r 01e82c562e59 -r 2f1c4b2716ea pidgin/gtkblist.c --- a/pidgin/gtkblist.c Thu Sep 20 18:59:34 2007 +0000 +++ b/pidgin/gtkblist.c Fri Sep 21 12:56:21 2007 +0000 @@ -3105,7 +3105,7 @@ { N_("/_Help"), NULL, NULL, 0, "", NULL }, { N_("/Help/Online _Help"), "F1", gtk_blist_show_onlinehelp_cb, 0, "", GTK_STOCK_HELP }, { N_("/Help/_Debug Window"), NULL, toggle_debug, 0, "", NULL }, -#if GTK_CHECK_VERSION(2,6,0) +#if GTK_CHECK_VERSION(2,6,0) { N_("/Help/_About"), NULL, pidgin_dialogs_about, 0, "", GTK_STOCK_ABOUT }, #else { N_("/Help/_About"), NULL, pidgin_dialogs_about, 0, "", NULL }, @@ -4820,7 +4820,7 @@ "visible", EMBLEM_VISIBLE_COLUMN, NULL); rend = gtk_cell_renderer_pixbuf_new(); - gtk_tree_view_column_pack_start(column, rend, FALSE); + gtk_tree_view_column_pack_start(column, rend, FALSE); gtk_tree_view_column_set_attributes(column, rend, "pixbuf", PROTOCOL_ICON_COLUMN, "visible", PROTOCOL_ICON_VISIBLE_COLUMN, @@ -5265,7 +5265,7 @@ group = (PurpleGroup*)gnode; textcolor = gtkblist->treeview->style->fg[GTK_STATE_ACTIVE]; - + if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(gtkblist->treeview)), NULL, &iter)) { gtk_tree_model_get(GTK_TREE_MODEL(gtkblist->treemodel), &iter, NODE_COLUMN, &selected_node, -1); @@ -6319,9 +6319,13 @@ gtkblist->headline_callback = callback; gtkblist->headline_data = user_data; gtkblist->headline_destroy = destroy; - if (!GTK_WIDGET_HAS_FOCUS(gtkblist->window)) - pidgin_set_urgent(GTK_WINDOW(gtkblist->window), TRUE); - gtk_widget_show_all(gtkblist->headline_hbox); + if (text != NULL || pixbuf != NULL) { + if (!GTK_WIDGET_HAS_FOCUS(gtkblist->window)) + pidgin_set_urgent(GTK_WINDOW(gtkblist->window), TRUE); + gtk_widget_show_all(gtkblist->headline_hbox); + } else { + gtk_widget_hide(gtkblist->headline_hbox); + } } static PurpleBlistUiOps blist_ui_ops = diff -r 01e82c562e59 -r 2f1c4b2716ea pidgin/gtknotify.c --- a/pidgin/gtknotify.c Thu Sep 20 18:59:34 2007 +0000 +++ b/pidgin/gtknotify.c Fri Sep 21 12:56:21 2007 +0000 @@ -413,7 +413,7 @@ * count > 0 mean non-detailed. */ static void * -pidgin_notify_add_mail(GtkTreeStore *treemodel, PurpleAccount *account, char *notification, const char *url, int count) +pidgin_notify_add_mail(GtkTreeStore *treemodel, PurpleAccount *account, char *notification, const char *url, int count, gboolean clear) { PidginNotifyMailData *data = NULL; GtkTreeIter iter; @@ -422,20 +422,30 @@ icon = pidgin_create_prpl_icon(account, PIDGIN_PRPL_ICON_MEDIUM); - if (count > 0) { + if (count > 0 || clear) { /* Allow only one non-detailed email notification for each account */ if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(treemodel), &iter)) { + gboolean advanced; do { + advanced = FALSE; gtk_tree_model_get(GTK_TREE_MODEL(treemodel), &iter, PIDGIN_MAIL_DATA, &data, -1); - if (data->account == account && data->count > 0) { - new_n = FALSE; - g_free(data->url); - data->url = NULL; - mail_dialog->total_count -= data->count; - break; + if (data->account == account) { + if (clear) { + advanced = gtk_tree_store_remove(treemodel, &iter); + purple_notify_close(PURPLE_NOTIFY_EMAILS, data); + /* We're completely done if we've processed all entries */ + if (!advanced) + return NULL; + } else if (data->count > 0) { + new_n = FALSE; + g_free(data->url); + data->url = NULL; + mail_dialog->total_count -= data->count; + break; + } } - } while (gtk_tree_model_iter_next(GTK_TREE_MODEL(treemodel), &iter)); + } while (advanced || gtk_tree_model_iter_next(GTK_TREE_MODEL(treemodel), &iter)); } } @@ -472,9 +482,13 @@ PurpleAccount *account; PidginNotifyMailData *data = NULL; + /* Don't bother updating if there aren't new emails and we don't have any displayed currently */ + if (count == 0 && mail_dialog == NULL) + return NULL; + account = purple_connection_get_account(gc); dialog = pidgin_get_mail_dialog(); /* This creates mail_dialog if necessary */ - + mail_dialog->total_count += count; if (detailed) { while (count--) { @@ -512,31 +526,46 @@ g_free(from_text); g_free(subject_text); - data = pidgin_notify_add_mail(mail_dialog->treemodel, account, notification, urls ? *urls : NULL, 0); + data = pidgin_notify_add_mail(mail_dialog->treemodel, account, notification, urls ? *urls : NULL, 0, FALSE); g_free(notification); if (urls != NULL) urls++; } } else { - notification = g_strdup_printf(ngettext("%s has %d new message.", - "%s has %d new messages.", - (int)count), - *tos, (int)count); - data = pidgin_notify_add_mail(mail_dialog->treemodel, account, notification, urls ? *urls : NULL, count); - g_free(notification); + if (count > 0) { + notification = g_strdup_printf(ngettext("%s has %d new message.", + "%s has %d new messages.", + (int)count), + *tos, (int)count); + data = pidgin_notify_add_mail(mail_dialog->treemodel, account, notification, urls ? *urls : NULL, count, FALSE); + g_free(notification); + } else { + GtkTreeIter iter; + + /* Clear out all mails for the account */ + pidgin_notify_add_mail(mail_dialog->treemodel, account, NULL, NULL, 0, TRUE); + + if (!gtk_tree_model_get_iter_first(GTK_TREE_MODEL(mail_dialog->treemodel), &iter)) { + /* There is no API to clear the headline specifically */ + /* This will trigger reset_mail_dialog() */ + pidgin_blist_set_headline(NULL, NULL, NULL, NULL, NULL); + } + + return NULL; + } } if (!GTK_WIDGET_VISIBLE(dialog)) { GdkPixbuf *pixbuf = gtk_widget_render_icon(dialog, PIDGIN_STOCK_DIALOG_MAIL, gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL), NULL); - char *label_text = g_strdup_printf(ngettext("You have %d new e-mail.", - "You have %d new e-mails.", + char *label_text = g_strdup_printf(ngettext("%d new e-mail.", + "%d new e-mails.", mail_dialog->total_count), mail_dialog->total_count); mail_dialog->in_use = TRUE; /* So that _set_headline doesn't accidentally remove the notifications when replacing an old notification. */ - pidgin_blist_set_headline(label_text, + pidgin_blist_set_headline(label_text, pixbuf, G_CALLBACK(gtk_widget_show_all), dialog, (GDestroyNotify)reset_mail_dialog); mail_dialog->in_use = FALSE; diff -r 01e82c562e59 -r 2f1c4b2716ea pidgin/pixmaps/protocols/22/myspace.png Binary file pidgin/pixmaps/protocols/22/myspace.png has changed diff -r 01e82c562e59 -r 2f1c4b2716ea pidgin/pixmaps/protocols/22/scalable/myspace.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pidgin/pixmaps/protocols/22/scalable/myspace.svg Fri Sep 21 12:56:21 2007 +0000 @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff -r 01e82c562e59 -r 2f1c4b2716ea pidgin/pixmaps/status/16/available.png Binary file pidgin/pixmaps/status/16/available.png has changed diff -r 01e82c562e59 -r 2f1c4b2716ea pidgin/pixmaps/status/16/away.png Binary file pidgin/pixmaps/status/16/away.png has changed diff -r 01e82c562e59 -r 2f1c4b2716ea pidgin/pixmaps/status/16/busy.png Binary file pidgin/pixmaps/status/16/busy.png has changed diff -r 01e82c562e59 -r 2f1c4b2716ea pidgin/pixmaps/status/16/extended-away.png Binary file pidgin/pixmaps/status/16/extended-away.png has changed diff -r 01e82c562e59 -r 2f1c4b2716ea pidgin/pixmaps/status/16/offline.png Binary file pidgin/pixmaps/status/16/offline.png has changed diff -r 01e82c562e59 -r 2f1c4b2716ea pidgin/pixmaps/status/16/rtl/extended-away.png Binary file pidgin/pixmaps/status/16/rtl/extended-away.png has changed diff -r 01e82c562e59 -r 2f1c4b2716ea pidgin/pixmaps/status/16/scalable/available.svg --- a/pidgin/pixmaps/status/16/scalable/available.svg Thu Sep 20 18:59:34 2007 +0000 +++ b/pidgin/pixmaps/status/16/scalable/available.svg Fri Sep 21 12:56:21 2007 +0000 @@ -13,13 +13,15 @@ height="16" id="svg2" sodipodi:version="0.32" - inkscape:version="0.44.1" + inkscape:version="0.45" version="1.0" inkscape:export-filename="/home/hbons/GUI/Tango/Gaim Refresh/status/16/available.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90" - sodipodi:docbase="/home/hbons/Desktop/experiment/status/16/scalable" - sodipodi:docname="available.svg"> + sodipodi:docbase="/home/hbons/Desktop/2.1.1/status/16/scalable" + sodipodi:docname="available.svg" + inkscape:output_extension="org.inkscape.output.svg.inkscape" + sodipodi:modified="true"> + inkscape:window-y="25" /> @@ -263,16 +265,6 @@ inkscape:groupmode="layer" id="layer1"> - + sodipodi:docbase="/home/hbons/Desktop/2.1.1/status/16/scalable" + sodipodi:docname="away.svg" + inkscape:output_extension="org.inkscape.output.svg.inkscape" + sodipodi:modified="true"> - + sodipodi:docbase="/home/hbons/Desktop/2.1.1/status/16/scalable" + sodipodi:docname="busy.svg" + inkscape:output_extension="org.inkscape.output.svg.inkscape" + sodipodi:modified="true"> + inkscape:window-x="3" + inkscape:window-y="25" /> @@ -210,16 +212,6 @@ inkscape:groupmode="layer" id="layer1"> - + inkscape:export-ydpi="90" + inkscape:output_extension="org.inkscape.output.svg.inkscape" + sodipodi:modified="true"> + inkscape:window-width="1440" + inkscape:window-height="847" + inkscape:window-x="0" + inkscape:window-y="22" /> @@ -79,27 +81,17 @@ inkscape:label="Layer 1" inkscape:groupmode="layer"> - + sodipodi:nodetypes="ccccccc" + transform="matrix(-1.708738,0,0,1.647118,-1.878642,-0.867731)" /> + sodipodi:nodetypes="cccccc" + transform="matrix(-1.398059,0,0,1.342047,-8.253506e-2,0.574281)" /> + sodipodi:docbase="/home/hbons/Desktop/2.1.1/status/16/scalable" + sodipodi:docname="offline.svg" + inkscape:output_extension="org.inkscape.output.svg.inkscape" + sodipodi:modified="true"> + inkscape:window-x="3" + inkscape:window-y="25" /> @@ -186,16 +188,6 @@ inkscape:groupmode="layer" id="layer1"> -