]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
maildir: Fixed maildir_sync_get_changes() to work as it should have.
authorTimo Sirainen <tss@iki.fi>
Tue, 25 Aug 2009 13:16:58 +0000 (09:16 -0400)
committerTimo Sirainen <tss@iki.fi>
Tue, 25 Aug 2009 13:16:58 +0000 (09:16 -0400)
--HG--
branch : HEAD

src/lib-storage/index/maildir/maildir-sync.c

index 96ae6a8def279504e85d9ba0b642a21851a3d696..13154a23c37b2b6bfb07d4e171cd2e6e4cd927dc 100644 (file)
@@ -678,23 +678,21 @@ static int maildir_sync_get_changes(struct maildir_sync_context *ctx,
                                     new_changed_r, cur_changed_r) < 0)
                return -1;
 
-       if (*new_changed_r || *cur_changed_r)
-               return 1;
-
        if (have_recent_messages(ctx)) {
                if ((mbox->ibox.box.flags & MAILBOX_FLAG_KEEP_RECENT) == 0) {
                        *new_changed_r = TRUE;
-                       return 1;
                } else if (*new_changed_r) {
                        /* we have some recent messages and new/ has changed.
                           if messages had been externally deleted from new/,
                           we need to get them out of index. this requires that
                           we make sure they weren't just moved to cur/. */
                        *cur_changed_r = TRUE;
-                       return 1;
                }
        }
 
+       if (*new_changed_r || *cur_changed_r)
+               return 1;
+
        if ((mbox->ibox.box.flags & MAILBOX_FLAG_KEEP_RECENT) == 0)
                flags |= MAIL_INDEX_SYNC_FLAG_DROP_RECENT;