dovecot-2.0: virtual: Support +mailbox entries that clear \Recen...

dovecot at dovecot.org dovecot at dovecot.org
Wed Mar 16 19:18:03 EET 2011


details:   http://hg.dovecot.org/dovecot-2.0/rev/be0f0de75e34
changeset: 12687:be0f0de75e34
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Mar 16 19:17:57 2011 +0200
description:
virtual: Support +mailbox entries that clear \Recent flag from messages.

diffstat:

 src/plugins/virtual/virtual-config.c  |  7 ++++++-
 src/plugins/virtual/virtual-storage.c |  3 ++-
 src/plugins/virtual/virtual-storage.h |  1 +
 3 files changed, 9 insertions(+), 2 deletions(-)

diffs (48 lines):

diff -r 310f2784de31 -r be0f0de75e34 src/plugins/virtual/virtual-config.c
--- a/src/plugins/virtual/virtual-config.c	Wed Mar 16 18:40:40 2011 +0200
+++ b/src/plugins/virtual/virtual-config.c	Wed Mar 16 19:17:57 2011 +0200
@@ -134,7 +134,7 @@
 	if (strcasecmp(line, "INBOX") == 0)
 		line = "INBOX";
 	bbox->name = p_strdup(ctx->pool, line);
-	if (*line == '-' || *line == '!') line++;
+	if (*line == '-' || *line == '+' || *line == '!') line++;
 	bbox->ns = strcasecmp(line, "INBOX") == 0 ?
 		mail_namespace_find_inbox(user->namespaces) :
 		mail_namespace_find(user->namespaces, &line);
@@ -143,6 +143,11 @@
 					   bbox->name);
 		return -1;
 	}
+	if (bbox->name[0] == '+') {
+		bbox->name++;
+		bbox->clear_recent = TRUE;
+	}
+
 	if (strchr(bbox->name, '*') != NULL ||
 	    strchr(bbox->name, '%') != NULL) {
 		name = bbox->name[0] == '-' ? bbox->name + 1 : bbox->name;
diff -r 310f2784de31 -r be0f0de75e34 src/plugins/virtual/virtual-storage.c
--- a/src/plugins/virtual/virtual-storage.c	Wed Mar 16 18:40:40 2011 +0200
+++ b/src/plugins/virtual/virtual-storage.c	Wed Mar 16 19:17:57 2011 +0200
@@ -173,7 +173,8 @@
 
 	i_assert(bbox->box == NULL);
 
-	flags |= MAILBOX_FLAG_KEEP_RECENT;
+	if (!bbox->clear_recent)
+		flags |= MAILBOX_FLAG_KEEP_RECENT;
 
 	mailbox = bbox->name;
 	ns = mail_namespace_find(user->namespaces, &mailbox);
diff -r 310f2784de31 -r be0f0de75e34 src/plugins/virtual/virtual-storage.h
--- a/src/plugins/virtual/virtual-storage.h	Wed Mar 16 18:40:40 2011 +0200
+++ b/src/plugins/virtual/virtual-storage.h	Wed Mar 16 19:17:57 2011 +0200
@@ -95,6 +95,7 @@
 
 	unsigned int sync_seen:1;
 	unsigned int wildcard:1;
+	unsigned int clear_recent:1;
 	unsigned int uids_nonsorted:1;
 };
 ARRAY_DEFINE_TYPE(virtual_backend_box, struct virtual_backend_box *);


More information about the dovecot-cvs mailing list