[dovecot-cvs] dovecot/src/imap cmd-namespace.c,1.1,1.2 namespace.c,1.2,1.3 namespace.h,1.2,1.3

cras at procontrol.fi cras at procontrol.fi
Mon Sep 15 18:02:09 EEST 2003


Update of /home/cvs/dovecot/src/imap
In directory danu:/tmp/cvs-serv32491/imap

Modified Files:
	cmd-namespace.c namespace.c namespace.h 
Log Message:
Added hidden-option to namespaces to hide them from NAMESPACE reply.



Index: cmd-namespace.c
===================================================================
RCS file: /home/cvs/dovecot/src/imap/cmd-namespace.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- cmd-namespace.c	27 Jul 2003 04:48:32 -0000	1.1
+++ cmd-namespace.c	15 Sep 2003 14:02:07 -0000	1.2
@@ -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;

Index: namespace.c
===================================================================
RCS file: /home/cvs/dovecot/src/imap/namespace.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- namespace.c	6 Sep 2003 17:44:51 -0000	1.2
+++ namespace.c	15 Sep 2003 14:02:07 -0000	1.3
@@ -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) {

Index: namespace.h
===================================================================
RCS file: /home/cvs/dovecot/src/imap/namespace.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- namespace.h	6 Sep 2003 17:44:51 -0000	1.2
+++ namespace.h	15 Sep 2003 14:02:07 -0000	1.3
@@ -13,7 +13,7 @@
         enum namespace_type type;
 	char hierarchy_sep;
 	char *prefix;
-	int inbox;
+	int inbox, hidden;
 	struct mail_storage *storage;
 };
 



More information about the dovecot-cvs mailing list