changeset 7330:93f67b71476c HEAD

Added MAIL_INDEX_MAIL_FLAG_BACKEND flag that can be used for backend-specific uses.
author Timo Sirainen <tss@iki.fi>
date Tue, 04 Mar 2008 04:05:35 +0200
parents d2b10facb504
children 9ef06104648a
files src/lib-index/mail-index-view-sync.c src/lib-index/mail-index.h
diffstat 2 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-index/mail-index-view-sync.c	Tue Mar 04 03:47:57 2008 +0200
+++ b/src/lib-index/mail-index-view-sync.c	Tue Mar 04 04:05:35 2008 +0200
@@ -502,7 +502,7 @@
 
 #define FLAG_UPDATE_IS_INTERNAL(u) \
 	((((u)->add_flags | (u)->remove_flags) & \
-	  ~MAIL_INDEX_MAIL_FLAG_DIRTY) == 0)
+	  MAIL_INDEX_FLAGS_MASK) == 0)
 
 static bool
 mail_index_view_sync_get_rec(struct mail_index_view_sync_ctx *ctx,
--- a/src/lib-index/mail-index.h	Tue Mar 04 03:47:57 2008 +0200
+++ b/src/lib-index/mail-index.h	Tue Mar 04 04:05:35 2008 +0200
@@ -36,7 +36,10 @@
 };
 
 enum mail_index_mail_flags {
-	MAIL_INDEX_MAIL_FLAG_DIRTY = 0x80
+	/* For private use by backend. Replacing flags doesn't change this. */
+	MAIL_INDEX_MAIL_FLAG_BACKEND	= 0x40,
+	/* Message flags haven't been written to backend */
+	MAIL_INDEX_MAIL_FLAG_DIRTY	= 0x80
 };
 
 #define MAIL_INDEX_FLAGS_MASK \
@@ -245,9 +248,9 @@
    Changes done to the returned transaction are expected to describe the
    mailbox's current state.
 
-   The returned view already contains all the changes, so if e.g. a record's
-   flags are different in view than in the mailbox you can assume that they
-   were changed externally, and you need to update the index.
+   The returned view already contains all the changes (except expunge
+   requests). After applying sync records on top of backend flags they should
+   match flags in the view. If they don't, there have been external changes.
 
    Returned expunges are treated as expunge requests. They're not really
    removed from the index until you mark them expunged to the returned