changeset 3358:d6723f532d26 HEAD

Removed SYNC_FAST_FLAG from EXPUNGE command. Changed delay-newmail workaround to also delay EXPUNGE notifications, otherwise things break. Changed index to force this with assert.
author Timo Sirainen <tss@iki.fi>
date Sun, 08 May 2005 13:09:43 +0300
parents 2d8874b023ea
children 455b4a29166c
files src/imap/cmd-expunge.c src/imap/imap-sync.c src/lib-index/mail-index-view-sync.c
diffstat 3 files changed, 18 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/imap/cmd-expunge.c	Sun May 08 12:38:36 2005 +0300
+++ b/src/imap/cmd-expunge.c	Sun May 08 13:09:43 2005 +0300
@@ -28,10 +28,9 @@
 	if (search_arg == NULL)
 		return TRUE;
 
-	if (imap_expunge(client->mailbox, search_arg)) {
-		return cmd_sync(cmd, MAILBOX_SYNC_FLAG_FAST,
-				"OK Expunge completed.");
-	} else {
+	if (imap_expunge(client->mailbox, search_arg))
+		return cmd_sync(cmd, 0, "OK Expunge completed.");
+	else {
 		client_send_storage_error(cmd,
 					  mailbox_get_storage(client->mailbox));
 		return TRUE;
@@ -45,10 +44,9 @@
 	if (!client_verify_open_mailbox(cmd))
 		return TRUE;
 
-	if (imap_expunge(client->mailbox, NULL)) {
-		return cmd_sync(cmd, MAILBOX_SYNC_FLAG_FAST,
-				"OK Expunge completed.");
-	} else {
+	if (imap_expunge(client->mailbox, NULL))
+		return cmd_sync(cmd, 0, "OK Expunge completed.");
+	else {
 		client_send_storage_error(cmd,
 					  mailbox_get_storage(client->mailbox));
 		return TRUE;
--- a/src/imap/imap-sync.c	Sun May 08 12:38:36 2005 +0300
+++ b/src/imap/imap-sync.c	Sun May 08 13:09:43 2005 +0300
@@ -196,8 +196,14 @@
 	}
 
 	if ((client_workarounds & WORKAROUND_DELAY_NEWMAIL) != 0 &&
-	    (flags & MAILBOX_SYNC_FLAG_FAST) != 0)
-		flags |= MAILBOX_SYNC_FLAG_NO_NEWMAIL;
+	    (flags & MAILBOX_SYNC_FLAG_FAST) != 0) {
+		/* expunges might break just as badly as new mail
+		   notifications. besides, currently indexing code doesn't
+		   handle expunges + no-newmail so this is required, unless
+		   we did this only for no-expunges case.. */
+		flags |= MAILBOX_SYNC_FLAG_NO_NEWMAIL |
+			MAILBOX_SYNC_FLAG_NO_EXPUNGES;
+	}
 
 	ctx = p_new(cmd->pool, struct cmd_sync_context, 1);
 	ctx->tagline = p_strdup(cmd->pool, tagline);
--- a/src/lib-index/mail-index-view-sync.c	Sun May 08 12:38:36 2005 +0300
+++ b/src/lib-index/mail-index-view-sync.c	Sun May 08 13:09:43 2005 +0300
@@ -160,6 +160,10 @@
 	/* We must sync flags as long as view is mmap()ed, as the flags may
 	   have already changed under us. */
 	i_assert((sync_mask & MAIL_INDEX_SYNC_TYPE_FLAGS) != 0);
+	/* Currently we're not handling correctly expunges + no-appends case */
+	i_assert((sync_mask & MAIL_INDEX_SYNC_TYPE_EXPUNGE) == 0 ||
+		 (sync_mask & MAIL_INDEX_SYNC_TYPE_APPEND) != 0);
+
 	i_assert(!view->syncing);
 	i_assert(view->transactions == 0);