[Goodies-commits] r5325 - in xfce4-mailwatch-plugin/trunk: . libmailwatch-core
Brian Tarricone
kelnos at xfce.org
Sat Aug 30 10:44:59 CEST 2008
Author: kelnos
Date: 2008-08-30 08:44:59 +0000 (Sat, 30 Aug 2008)
New Revision: 5325
Modified:
xfce4-mailwatch-plugin/trunk/NEWS
xfce4-mailwatch-plugin/trunk/libmailwatch-core/mailwatch-mailbox-imap.c
Log:
fix deleted new-mail folders sometimes showing up later (bug 2647)
Modified: xfce4-mailwatch-plugin/trunk/NEWS
===================================================================
--- xfce4-mailwatch-plugin/trunk/NEWS 2008-08-30 08:38:34 UTC (rev 5324)
+++ xfce4-mailwatch-plugin/trunk/NEWS 2008-08-30 08:44:59 UTC (rev 5325)
@@ -14,6 +14,7 @@
keyboard rather than the mouse (bug 2386).
* Fix problems receiving full commands on IMAP accounts (bug 2416).
* Fix problems receiving full commands on POP3 accounts (bug 2013).
+ * Fix removed new-mail folders sometimes re-adding themselves (bug 2647).
Features:
* Update the new message counts for all mailboxes on startup, rather than
Modified: xfce4-mailwatch-plugin/trunk/libmailwatch-core/mailwatch-mailbox-imap.c
===================================================================
--- xfce4-mailwatch-plugin/trunk/libmailwatch-core/mailwatch-mailbox-imap.c 2008-08-30 08:38:34 UTC (rev 5324)
+++ xfce4-mailwatch-plugin/trunk/libmailwatch-core/mailwatch-mailbox-imap.c 2008-08-30 08:44:59 UTC (rev 5325)
@@ -1802,8 +1802,8 @@
imap_restore_param_list(XfceMailwatchMailbox *mailbox, GList *params)
{
XfceMailwatchIMAPMailbox *imailbox = XFCE_MAILWATCH_IMAP_MAILBOX(mailbox);
- GList *l, *inbox_l;
- gint n_newmail_boxes = -1;
+ GList *l;
+ gint n_newmail_boxes = 0;
g_mutex_lock(imailbox->config_mx);
@@ -1830,27 +1830,32 @@
n_newmail_boxes = atoi(param->value);
}
- /* save the dummy 'inbox' item for later */
- inbox_l = imailbox->mailboxes_to_check;
- imailbox->mailboxes_to_check = NULL;
-
- for(l = params; l; l = l->next) {
- XfceMailwatchParam *param = l->data;
+ if(n_newmail_boxes > 0) {
+ /* save the dummy 'inbox' item for later */
+ GList *inbox_l = imailbox->mailboxes_to_check;
+ imailbox->mailboxes_to_check = NULL;
- if(!strncmp(param->key, "newmail_box_", 12)) {
- imailbox->mailboxes_to_check =
- g_list_prepend(imailbox->mailboxes_to_check,
- g_strdup(param->value));
- DBG("IMAP: config: got a new mail folder: %s", param->value);
+ for(l = params; l; l = l->next) {
+ XfceMailwatchParam *param = l->data;
+
+ if(!strncmp(param->key, "newmail_box_", 12)) {
+ gint box_index = atoi(param->key + 12);
+ if(box_index >= n_newmail_boxes)
+ continue;
+
+ imailbox->mailboxes_to_check = g_list_prepend(imailbox->mailboxes_to_check,
+ g_strdup(param->value));
+ DBG("IMAP: config: got a new mail folder: %s", param->value);
+ }
}
+
+ if(imailbox->mailboxes_to_check) {
+ imailbox->mailboxes_to_check = g_list_reverse(imailbox->mailboxes_to_check);
+ g_list_free(inbox_l);
+ } else
+ imailbox->mailboxes_to_check = inbox_l;
}
- if(imailbox->mailboxes_to_check) {
- imailbox->mailboxes_to_check = g_list_reverse(imailbox->mailboxes_to_check);
- g_list_free(inbox_l);
- } else
- imailbox->mailboxes_to_check = inbox_l;
-
g_mutex_unlock(imailbox->config_mx);
}
More information about the Goodies-commits
mailing list