[dovecot-cvs] dovecot/src/lib-index mail-index-sync-update.c, 1.107, 1.108

tss at dovecot.org tss at dovecot.org
Tue Jan 23 13:29:48 UTC 2007


Update of /var/lib/cvs/dovecot/src/lib-index
In directory talvi:/tmp/cvs-serv8274

Modified Files:
	mail-index-sync-update.c 
Log Message:
cleanups



Index: mail-index-sync-update.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-index-sync-update.c,v
retrieving revision 1.107
retrieving revision 1.108
diff -u -d -r1.107 -r1.108
--- mail-index-sync-update.c	17 Jan 2007 23:33:29 -0000	1.107
+++ mail-index-sync-update.c	23 Jan 2007 13:29:44 -0000	1.108
@@ -298,13 +298,13 @@
 	if ((rec->flags & MAIL_INDEX_MAIL_FLAG_DIRTY) != 0)
 		map->hdr.flags |= MAIL_INDEX_HDR_FLAG_HAVE_DIRTY;
 
+	mail_index_header_update_lowwaters(&map->hdr, rec);
 	if (!view->broken_counters) {
 		if (mail_index_header_update_counts(&map->hdr, 0, rec->flags,
 						    &error) < 0) {
 			mail_index_sync_set_corrupted(ctx, "%s", error);
 			return -1;
 		}
-		mail_index_header_update_lowwaters(&map->hdr, rec);
 	}
 	return 1;
 }
@@ -341,10 +341,10 @@
 
         flag_mask = ~u->remove_flags;
 
-	if (view->broken_counters ||
-	    (ctx->unreliable_flags &&
-	     ((u->add_flags | u->remove_flags) &
-	      (MAIL_SEEN | MAIL_DELETED | MAIL_RECENT)) != 0)) {
+	if (((u->add_flags | u->remove_flags) &
+	     (MAIL_SEEN | MAIL_DELETED | MAIL_RECENT)) == 0) {
+		/* we're not modifying any counted/lowwatered flags */
+	} else if (view->broken_counters || ctx->unreliable_flags) {
 		view->broken_counters = TRUE;
 		for (idx = seq1-1; idx < seq2; idx++) {
 			rec = MAIL_INDEX_MAP_IDX(view->map, idx);
@@ -359,13 +359,13 @@
 			old_flags = rec->flags;
 			rec->flags = (rec->flags & flag_mask) | u->add_flags;
 
+			mail_index_header_update_lowwaters(hdr, rec);
 			if (mail_index_header_update_counts(hdr, old_flags,
 							    rec->flags,
 							    &error) < 0) {
 				mail_index_sync_set_corrupted(ctx, "%s", error);
 				return -1;
 			}
-			mail_index_header_update_lowwaters(hdr, rec);
 		}
 	}
 	return 1;



More information about the dovecot-cvs mailing list