]> granicus.if.org Git - mutt/commitdiff
Try to fix #943.
authorThomas Roessler <roessler@does-not-exist.org>
Tue, 8 Jan 2002 13:06:21 +0000 (13:06 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Tue, 8 Jan 2002 13:06:21 +0000 (13:06 +0000)
mx.c

diff --git a/mx.c b/mx.c
index 213fa6f5d180c59871b2438d3c8079f3c510efe0..f0631f48832acf1dd6bad7101b82b7a53d9a70e4 100644 (file)
--- a/mx.c
+++ b/mx.c
@@ -1185,7 +1185,7 @@ int mx_sync_mailbox (CONTEXT *ctx, int *index_hint)
     
     if (ctx->msgcount == ctx->deleted &&
        (ctx->magic == M_MBOX || ctx->magic == M_MMDF) &&
-       !mutt_is_spool(ctx->path) && !option (OPTSAVEEMPTY))
+       !mutt_is_spool (ctx->path) && !option (OPTSAVEEMPTY))
     {
       unlink (ctx->path);
       mx_fastclose_mailbox (ctx);
@@ -1193,7 +1193,13 @@ int mx_sync_mailbox (CONTEXT *ctx, int *index_hint)
     }
 
     /* if we haven't deleted any messages, we don't need to resort */
-    if (purge)
+    /* ... except for certain folder formats which need "unsorted" 
+     * sort order in order to synchronize folders.
+     * 
+     * MH and maildir are safe.  mbox-style seems to need re-sorting,
+     * at least with the new threading code.
+     */
+    if (purge || (ctx->magic != M_MAILDIR && ctx->magic != M_MH))
     {
 #ifdef USE_IMAP
       /* IMAP does this automatically after handling EXPUNGE */