[dovecot-cvs] dovecot/src/lib-index mail-index-sync-update.c, 1.96.2.8, 1.96.2.9

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


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

Modified Files:
      Tag: branch_1_0
	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.96.2.8
retrieving revision 1.96.2.9
diff -u -d -r1.96.2.8 -r1.96.2.9
--- mail-index-sync-update.c	17 Jan 2007 23:33:26 -0000	1.96.2.8
+++ mail-index-sync-update.c	23 Jan 2007 13:29:43 -0000	1.96.2.9
@@ -297,13 +297,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;
 }
@@ -340,10 +340,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);
@@ -358,13 +358,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