dovecot-2.2: lib-storage: Fixed shared namespace autocreation af...
dovecot at dovecot.org
dovecot at dovecot.org
Tue Sep 25 22:53:59 EEST 2012
details: http://hg.dovecot.org/dovecot-2.2/rev/f0d487918a2b
changeset: 15106:f0d487918a2b
user: Timo Sirainen <tss at iki.fi>
date: Tue Sep 25 22:51:46 2012 +0300
description:
lib-storage: Fixed shared namespace autocreation after previous mailbox list changes.
mailbox_list_is_valid_existing_name() no longer goes all the way through to
shared-list backend, but mailbox_list_join_refpattern() does.
diffstat:
src/lib-storage/index/shared/shared-list.c | 4 +++-
src/lib-storage/list/mailbox-list-subscriptions.c | 9 ++++-----
2 files changed, 7 insertions(+), 6 deletions(-)
diffs (48 lines):
diff -r 7766229d8f3e -r f0d487918a2b src/lib-storage/index/shared/shared-list.c
--- a/src/lib-storage/index/shared/shared-list.c Tue Sep 25 22:40:55 2012 +0300
+++ b/src/lib-storage/index/shared/shared-list.c Tue Sep 25 22:51:46 2012 +0300
@@ -120,6 +120,7 @@
shared_list_create_missing_namespaces(struct mailbox_list *list,
const char *const *patterns)
{
+ struct mail_namespace *ns;
char sep = mail_namespace_get_sep(list->ns);
const char *list_pat, *name;
unsigned int i;
@@ -142,8 +143,9 @@
last = p;
}
if (last != NULL) {
+ ns = list->ns;
name = t_strdup_until(list_pat, last);
- (void)mailbox_list_is_valid_existing_name(list, name);
+ (void)shared_storage_get_namespace(&ns, &name);
}
}
}
diff -r 7766229d8f3e -r f0d487918a2b src/lib-storage/list/mailbox-list-subscriptions.c
--- a/src/lib-storage/list/mailbox-list-subscriptions.c Tue Sep 25 22:40:55 2012 +0300
+++ b/src/lib-storage/list/mailbox-list-subscriptions.c Tue Sep 25 22:51:46 2012 +0300
@@ -27,7 +27,7 @@
struct mail_namespace *ns, *default_ns = list->ns;
struct mail_namespace *namespaces = default_ns->user->namespaces;
struct mailbox_node *node;
- const char *vname, *ns_name, *list_name;
+ const char *vname, *ns_name;
unsigned int len;
bool created;
@@ -59,10 +59,9 @@
if (ns != NULL && ns->type == MAIL_NAMESPACE_TYPE_SHARED &&
(ns->flags & NAMESPACE_FLAG_AUTOCREATED) == 0) {
/* we'll need to get the namespace autocreated.
- one easy way is to just ask if a mailbox name under
- it is valid, and it gets created */
- list_name = ns_name + ns->prefix_len;
- (void)mailbox_list_is_valid_existing_name(list, list_name);
+ one easy way is to just ask to join a reference and
+ pattern */
+ (void)mailbox_list_join_refpattern(ns->list, ns_name, "");
}
/* When listing pub/ namespace, skip over the namespace
More information about the dovecot-cvs
mailing list