From b7389cb36f7b8487f200763a8c57ea8062152140 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 20 Mar 2006 20:39:06 +0000 Subject: [PATCH] do not repeatedly get namespace from server. --- src/drv_imap.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/drv_imap.c b/src/drv_imap.c index 1a0757e..de2a5b9 100644 --- a/src/drv_imap.c +++ b/src/drv_imap.c @@ -112,6 +112,7 @@ typedef struct imap_store { const char *prefix; unsigned /*currentnc:1,*/ trashnc:1; int uidnext; /* from SELECT responses */ + unsigned got_namespace:1; list_t *ns_personal, *ns_other, *ns_shared; /* NAMESPACE info */ message_t **msgapp; /* FETCH results */ unsigned caps, rcaps; /* CAPABILITY results */ @@ -1400,8 +1401,11 @@ imap_open_store( store_conf_t *conf ) ctx->prefix = conf->path; else if (cfg->use_namespace && CAP(NAMESPACE)) { /* get NAMESPACE info */ - if (imap_exec( ctx, 0, "NAMESPACE" ) != RESP_OK) - goto bail; + if (!ctx->got_namespace) { + if (imap_exec( ctx, 0, "NAMESPACE" ) != RESP_OK) + goto bail; + ctx->got_namespace = 1; + } /* XXX for now assume personal namespace */ if (is_list( ctx->ns_personal ) && is_list( ctx->ns_personal->child ) &&