changeset 5565:64bdb703f6bd HEAD

HAS_INBOX flag wasn't correctly set to namespaces.
author Timo Sirainen <tss@iki.fi>
date Tue, 17 Apr 2007 18:29:37 +0300
parents 47274663a71c
children 88307a648e0e
files src/lib-storage/mail-namespace.c
diffstat 1 files changed, 8 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/mail-namespace.c	Tue Apr 17 18:09:10 2007 +0300
+++ b/src/lib-storage/mail-namespace.c	Tue Apr 17 18:29:37 2007 +0300
@@ -31,17 +31,17 @@
 {
         struct mail_namespace *ns;
         const char *sep, *type, *prefix;
-	bool inbox, hidden, subscriptions;
 
 	ns = p_new(pool, struct mail_namespace, 1);
 
 	sep = getenv(t_strdup_printf("NAMESPACE_%u_SEP", num));
 	type = getenv(t_strdup_printf("NAMESPACE_%u_TYPE", num));
 	prefix = getenv(t_strdup_printf("NAMESPACE_%u_PREFIX", num));
-	inbox = getenv(t_strdup_printf("NAMESPACE_%u_INBOX", num)) != NULL;
-	hidden = getenv(t_strdup_printf("NAMESPACE_%u_HIDDEN", num)) != NULL;
-	subscriptions = getenv(t_strdup_printf("NAMESPACE_%u_SUBSCRIPTIONS",
-					       num)) != NULL;
+	ns->inbox = getenv(t_strdup_printf("NAMESPACE_%u_INBOX", num)) != NULL;
+	ns->hidden = getenv(t_strdup_printf("NAMESPACE_%u_HIDDEN",
+					    num)) != NULL;
+	ns->subscriptions = getenv(t_strdup_printf("NAMESPACE_%u_SUBSCRIPTIONS",
+						   num)) != NULL;
 
 	if (type == NULL || *type == '\0' || strncmp(type, "private", 7) == 0)
 		ns->type = NAMESPACE_PRIVATE;
@@ -66,15 +66,12 @@
 		i_info("Namespace: type=%s, prefix=%s, sep=%s, "
 		       "inbox=%s, hidden=%s, subscriptions=%s",
 		       type == NULL ? "" : type, prefix, sep == NULL ? "" : sep,
-		       inbox ? "yes" : "no",
-		       hidden ? "yes" : "no",
-		       subscriptions ? "yes" : "no");
+		       ns->inbox ? "yes" : "no",
+		       ns->hidden ? "yes" : "no",
+		       ns->subscriptions ? "yes" : "no");
 	}
 
 	ns->prefix = p_strdup(pool, prefix);
-	ns->inbox = inbox;
-	ns->hidden = hidden;
-	ns->subscriptions = subscriptions;
 	if (mail_storage_create(ns, NULL, data, user, flags, lock_method) < 0) {
 		i_error("Failed to create storage for '%s' with data: %s",
 			ns->prefix, data);