commit b7389cb36f7b8487f200763a8c57ea8062152140
parent 340bfcc4a84a658da8e62071879b19f40d6f6d32
Author: Oswald Buddenhagen <ossi@users.sf.net>
Date: Mon, 20 Mar 2006 20:39:06 +0000
do not repeatedly get namespace from server.
Diffstat:
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git 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 ) &&