Hi all,

I noticed a bug when a folder on a IMAP server is moved sideways, e.g. from 
“INBOX/Folder1/Test” to “INBOX/Folder2/Test”: after moving, a partial re-scan 
of the mailbox tree is performed, which makes all my local folders disappear.  
The effect does not occur if the folder is moved up or down the tree.  I could 
track down the source of the issue to src/folder-conf.c, function 
subfolder_conf_clicked_ok().

At least for me, the attached patch fixes the problem:  simply re-scan the 
whole IMAP server folder tree.  As moving folders around on an IMAP server is 
typically not a frequent operation, the performance penalty (if there is any) 
should be negligible.

We /might/ even consider to simplify the whole block starting at 
src/folder-conf.c, line 566, to just re-scanning the whole server, but as I 
mentioned above, the other two use cases work fine for me.

Opinions?

Cheers,
Albrecht.

diff --git a/src/folder-conf.c b/src/folder-conf.c
index 7937edb2c..fe20d7458 100644
--- a/src/folder-conf.c
+++ b/src/folder-conf.c
@@ -586,13 +586,12 @@ folder, parent);
 		    }
                 } else {
                     /* moved it sideways: a chain of folders might
-                     * go away, so we'd better rescan from higher up
+                     * go away, so we'd better rescan the complete IMAP server
                      */
                     BalsaMailboxNode *mb = sdd->mbnode->parent;
-                    while (!mb->mailbox && mb->parent)
+                    while ((mb->mailbox != NULL) && (mb->parent != NULL))
                         mb = mb->parent;
                     balsa_mailbox_node_rescan(mb);
-                    balsa_mailbox_node_rescan(sdd->mbnode);
                 }
             }
         }

Attachment: pgppzYEmJAmnh.pgp
Description: PGP signature

_______________________________________________
balsa-list mailing list
[email protected]
https://mail.gnome.org/mailman/listinfo/balsa-list

Reply via email to