]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Added hidden-option to namespaces to hide them from NAMESPACE reply.
authorTimo Sirainen <tss@iki.fi>
Mon, 15 Sep 2003 14:02:07 +0000 (17:02 +0300)
committerTimo Sirainen <tss@iki.fi>
Mon, 15 Sep 2003 14:02:07 +0000 (17:02 +0300)
--HG--
branch : HEAD

src/imap/cmd-namespace.c
src/imap/namespace.c
src/imap/namespace.h
src/master/mail-process.c
src/master/master-settings.h

index 6529723aeb153c429ce80f55c80fd50ec3ba6855..f0b8a077b1378b72d7ac9a5d5fe40a3dcfaf2b67 100644 (file)
@@ -12,7 +12,7 @@ static void list_namespaces(struct namespace *ns, enum namespace_type type,
        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 16818c1422340e256c2a2c8ab4095d23ae84c520..98ef1fb9d66266e4587e497c2539dba20098e1eb 100644 (file)
@@ -12,7 +12,7 @@ namespace_add_env(pool_t pool, const char *data, unsigned int num,
 {
         struct namespace *ns;
         const char *sep, *type, *prefix;
-       int inbox;
+       int inbox, hidden;
 
        ns = p_new(pool, struct namespace, 1);
 
@@ -20,6 +20,7 @@ namespace_add_env(pool_t pool, const char *data, unsigned int 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;
 
        if (type == NULL || *type == '\0' || strncmp(type, "private", 7) == 0)
                ns->type = NAMESPACE_PRIVATE;
@@ -35,6 +36,7 @@ namespace_add_env(pool_t pool, const char *data, unsigned int num,
 
        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 d70b7ac024cd1a190ccc4ae5d474c3a56e6a0035..fb5ecd8cf5de0ba29cc466c9519d3e538c9a7749 100644 (file)
@@ -13,7 +13,7 @@ struct namespace {
         enum namespace_type type;
        char hierarchy_sep;
        char *prefix;
-       int inbox;
+       int inbox, hidden;
        struct mail_storage *storage;
 };
 
index e8785fbdc3f9d81472dbfee77fb0b59409c2009b..da1ab33d5b4cb48a4e06b3a26db7aaf5abdf9dd5 100644 (file)
@@ -139,6 +139,8 @@ static void env_put_namespace(struct namespace_settings *ns,
                }
                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();
        }
 }
index 2edd90352ea1f4360a3a7348a79727e0ebd115d5..ec79651a2c73981c4cbab4d7f999f310a448105b 100644 (file)
@@ -122,6 +122,7 @@ struct namespace_settings {
        const char *location;
 
        int inbox;
+       int hidden;
 };
 
 struct server_settings {