changeset 1773:9547667cfa19 HEAD

Added hidden-option to namespaces to hide them from NAMESPACE reply.
author Timo Sirainen <tss@iki.fi>
date Mon, 15 Sep 2003 17:02:07 +0300
parents c5fa45f0ebf6
children 57bd9be0ecff
files src/imap/cmd-namespace.c src/imap/namespace.c src/imap/namespace.h src/master/mail-process.c src/master/master-settings.h
diffstat 5 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/imap/cmd-namespace.c	Mon Sep 15 16:59:08 2003 +0300
+++ b/src/imap/cmd-namespace.c	Mon Sep 15 17:02:07 2003 +0300
@@ -12,7 +12,7 @@
 	int found = FALSE;
 
 	while (ns != NULL) {
-		if (ns->type == type) {
+		if (ns->type == type && !ns->hidden) {
 			if (!found) {
 				str_append_c(str, '(');
 				found = TRUE;
--- a/src/imap/namespace.c	Mon Sep 15 16:59:08 2003 +0300
+++ b/src/imap/namespace.c	Mon Sep 15 17:02:07 2003 +0300
@@ -12,7 +12,7 @@
 {
         struct namespace *ns;
         const char *sep, *type, *prefix;
-	int inbox;
+	int inbox, hidden;
 
 	ns = p_new(pool, struct namespace, 1);
 
@@ -20,6 +20,7 @@
 	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;
 
 	if (type == NULL || *type == '\0' || strncmp(type, "private", 7) == 0)
 		ns->type = NAMESPACE_PRIVATE;
@@ -35,6 +36,7 @@
 
 	ns->prefix = p_strdup(pool, prefix);
 	ns->inbox = inbox;
+	ns->hidden = hidden;
 	ns->storage = mail_storage_create_with_data(data, user, ns->prefix,
 						    sep != NULL ? *sep : '\0');
 	if (ns->storage == NULL) {
--- a/src/imap/namespace.h	Mon Sep 15 16:59:08 2003 +0300
+++ b/src/imap/namespace.h	Mon Sep 15 17:02:07 2003 +0300
@@ -13,7 +13,7 @@
         enum namespace_type type;
 	char hierarchy_sep;
 	char *prefix;
-	int inbox;
+	int inbox, hidden;
 	struct mail_storage *storage;
 };
 
--- a/src/master/mail-process.c	Mon Sep 15 16:59:08 2003 +0300
+++ b/src/master/mail-process.c	Mon Sep 15 17:02:07 2003 +0300
@@ -139,6 +139,8 @@
 		}
 		if (ns->inbox)
 			env_put(t_strdup_printf("NAMESPACE_%u_INBOX=1", i));
+		if (ns->hidden)
+			env_put(t_strdup_printf("NAMESPACE_%u_HIDDEN=1", i));
 		t_pop();
 	}
 }
--- a/src/master/master-settings.h	Mon Sep 15 16:59:08 2003 +0300
+++ b/src/master/master-settings.h	Mon Sep 15 17:02:07 2003 +0300
@@ -122,6 +122,7 @@
 	const char *location;
 
 	int inbox;
+	int hidden;
 };
 
 struct server_settings {