dovecot-2.2: layout=index: Fixed mailbox_exists()

dovecot at dovecot.org dovecot at dovecot.org
Wed Mar 20 17:59:38 EET 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/c742a7bf48a6
changeset: 16061:c742a7bf48a6
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Mar 20 17:59:32 2013 +0200
description:
layout=index: Fixed mailbox_exists()

diffstat:

 src/lib-storage/list/mailbox-list-index-backend.c |  15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diffs (32 lines):

diff -r 8bacc34cead9 -r c742a7bf48a6 src/lib-storage/list/mailbox-list-index-backend.c
--- a/src/lib-storage/list/mailbox-list-index-backend.c	Wed Mar 20 17:54:52 2013 +0200
+++ b/src/lib-storage/list/mailbox-list-index-backend.c	Wed Mar 20 17:59:32 2013 +0200
@@ -363,6 +363,20 @@
 	return 0;
 }
 
+static int
+index_list_mailbox_exists(struct mailbox *box, bool auto_boxes ATTR_UNUSED,
+			  enum mailbox_existence *existence_r)
+{
+	struct index_mailbox_list *list =
+		(struct index_mailbox_list *)box->list;
+
+	if (index_list_node_exists(list, box->name, existence_r) < 0) {
+		mail_storage_copy_list_error(box->storage, box->list);
+		return -1;
+	}
+	return 0;
+}
+
 static void
 index_list_try_delete(struct index_mailbox_list *list, const char *name,
 		      enum mailbox_list_path_type type)
@@ -663,6 +677,7 @@
 		return;
 	box->v.create_box = index_list_mailbox_create;
 	box->v.update_box = index_list_mailbox_update;
+	box->v.exists = index_list_mailbox_exists;
 
 	box->v.list_index_has_changed = NULL;
 	box->v.list_index_update_sync = NULL;


More information about the dovecot-cvs mailing list