| 555 advanced = gtk_tree_store_remove(treemodel, &iter); |
555 advanced = gtk_tree_store_remove(treemodel, &iter); |
| 556 #else |
556 #else |
| 557 gtk_tree_store_remove(treemodel, &iter); |
557 gtk_tree_store_remove(treemodel, &iter); |
| 558 advanced = (iter.stamp == 0) ? FALSE : TRUE; |
558 advanced = (iter.stamp == 0) ? FALSE : TRUE; |
| 559 #endif |
559 #endif |
| 560 purple_notify_close(PURPLE_NOTIFY_EMAILS, data); |
560 if (data->purple_has_handle) |
| |
561 purple_notify_close(PURPLE_NOTIFY_EMAILS, data); |
| |
562 else |
| |
563 pidgin_close_notify(PURPLE_NOTIFY_EMAILS, data); |
| 561 /* We're completely done if we've processed all entries */ |
564 /* We're completely done if we've processed all entries */ |
| 562 if (!advanced) |
565 if (!advanced) |
| 563 return NULL; |
566 return NULL; |
| 564 } else if (data->count > 0) { |
567 } else if (data->count > 0) { |
| 565 new_n = FALSE; |
568 new_n = FALSE; |
| 610 { |
613 { |
| 611 GtkWidget *dialog = NULL; |
614 GtkWidget *dialog = NULL; |
| 612 char *notification; |
615 char *notification; |
| 613 PurpleAccount *account; |
616 PurpleAccount *account; |
| 614 PidginNotifyMailData *data = NULL, *data2; |
617 PidginNotifyMailData *data = NULL, *data2; |
| 615 gboolean new_data; |
618 gboolean new_data = FALSE; |
| 616 |
619 |
| 617 /* Don't bother updating if there aren't new emails and we don't have any displayed currently */ |
620 /* Don't bother updating if there aren't new emails and we don't have any displayed currently */ |
| 618 if (count == 0 && mail_dialog == NULL) |
621 if (count == 0 && mail_dialog == NULL) |
| 619 return NULL; |
622 return NULL; |
| 620 |
623 |
| 658 g_free(from_text); |
661 g_free(from_text); |
| 659 g_free(subject_text); |
662 g_free(subject_text); |
| 660 |
663 |
| 661 /* If we don't keep track of this, will leak "data" for each of the notifications except the last */ |
664 /* If we don't keep track of this, will leak "data" for each of the notifications except the last */ |
| 662 data2 = pidgin_notify_add_mail(mail_dialog->treemodel, account, notification, urls ? *urls : NULL, 0, FALSE, &new_data); |
665 data2 = pidgin_notify_add_mail(mail_dialog->treemodel, account, notification, urls ? *urls : NULL, 0, FALSE, &new_data); |
| 663 if (new_data) { |
666 if (data2 && new_data) { |
| 664 if (data) |
667 if (data) |
| 665 data->purple_has_handle = FALSE; |
668 data->purple_has_handle = FALSE; |
| 666 data = data2; |
669 data = data2; |
| 667 } |
670 } |
| 668 g_free(notification); |
671 g_free(notification); |
| 675 notification = g_strdup_printf(ngettext("%s has %d new message.", |
678 notification = g_strdup_printf(ngettext("%s has %d new message.", |
| 676 "%s has %d new messages.", |
679 "%s has %d new messages.", |
| 677 (int)count), |
680 (int)count), |
| 678 *tos, (int)count); |
681 *tos, (int)count); |
| 679 data2 = pidgin_notify_add_mail(mail_dialog->treemodel, account, notification, urls ? *urls : NULL, count, FALSE, &new_data); |
682 data2 = pidgin_notify_add_mail(mail_dialog->treemodel, account, notification, urls ? *urls : NULL, count, FALSE, &new_data); |
| 680 if (new_data) { |
683 if (data2 && new_data) { |
| 681 if (data) |
684 if (data) |
| 682 data->purple_has_handle = FALSE; |
685 data->purple_has_handle = FALSE; |
| 683 data = data2; |
686 data = data2; |
| 684 } |
687 } |
| 685 g_free(notification); |
688 g_free(notification); |