changeset 9573:c2c1639b91ee HEAD

lib-storage: If read-only mailbox uses private flags, don't return it as READ-ONLY.
author Timo Sirainen <tss@iki.fi>
date Tue, 25 May 2010 16:07:43 +0100
parents 6f25b20b8367
children e63d38c7d2ba
files src/lib-storage/index/index-storage.c
diffstat 1 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/index/index-storage.c	Tue May 25 15:56:03 2010 +0100
+++ b/src/lib-storage/index/index-storage.c	Tue May 25 16:07:43 2010 +0100
@@ -511,8 +511,16 @@
 {
 	struct index_mailbox *ibox = (struct index_mailbox *) box;
 
-	return (ibox->box.open_flags & MAILBOX_OPEN_READONLY) != 0 ||
-		ibox->backend_readonly;
+	if ((ibox->box.open_flags & MAILBOX_OPEN_READONLY) != 0)
+		return TRUE;
+
+	if (ibox->backend_readonly) {
+		/* return read-only only if there are no private flags
+		   (that are stored in index files) */
+		if (box->private_flags_mask == 0)
+			return TRUE;
+	}
+	return FALSE;
 }
 
 bool index_storage_allow_new_keywords(struct mailbox *box)