dovecot-1.1: Added MAIL_INDEX_MAIL_FLAG_BACKEND flag that can be...

dovecot at dovecot.org dovecot at dovecot.org
Tue Mar 4 06:28:07 EET 2008


details:   http://hg.dovecot.org/dovecot-1.1/rev/93f67b71476c
changeset: 7330:93f67b71476c
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Mar 04 04:05:35 2008 +0200
description:
Added MAIL_INDEX_MAIL_FLAG_BACKEND flag that can be used for
backend-specific uses.

diffstat:

2 files changed, 8 insertions(+), 5 deletions(-)
src/lib-index/mail-index-view-sync.c |    2 +-
src/lib-index/mail-index.h           |   11 +++++++----

diffs (40 lines):

diff -r d2b10facb504 -r 93f67b71476c src/lib-index/mail-index-view-sync.c
--- 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 @@ mail_index_view_sync_get_next_transactio
 
 #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,
diff -r d2b10facb504 -r 93f67b71476c src/lib-index/mail-index.h
--- 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_header_flag {
 };
 
 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 @@ mail_index_transaction_open_updated_view
    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


More information about the dovecot-cvs mailing list