#if USE_HCACHE
header_cache_t *hc;
char uidbuf[32];
-
- hc = mutt_hcache_open (HeaderCache, idata->ctx->path);
+
+ hc = imap_hcache_open (idata, idata->ctx->path);
#endif
for (i = 0; i < idata->ctx->msgcount; i++)
#if USE_HCACHE
if (expunge && ctx->closing)
- hc = mutt_hcache_open (HeaderCache, idata->ctx->path);
+ hc = imap_hcache_open (idata, idata->ctx->path);
#endif
/* save messages with real (non-flag) changes */
char urlstr[LONG_STRING];
unsigned int *uidvalidity = NULL;
unsigned int *uidnext = NULL;
- char* path;
#endif
for (cur = idata->mboxcache; cur; cur = cur->next)
}
#ifdef USE_HCACHE
- path = safe_strdup (idata->ctx->path);
- url_parse_ciss (&url, path);
+ mutt_account_tourl (&idata->conn->account, &url);
url.path = (char*)mbox;
url_ciss_tostring (&url, urlstr, sizeof (urlstr), 0);
- FREE (&path);
hc = mutt_hcache_open (HeaderCache, urlstr);
if (hc)
{
int imap_cache_del (IMAP_DATA* idata, HEADER* h);
/* util.c */
+#ifdef USE_HCACHE
+void* imap_hcache_open (IMAP_DATA* idata, const char* path);
+#endif
+
int imap_continue (const char* msg, const char* resp);
void imap_error (const char* where, const char* msg);
IMAP_DATA* imap_new_idata (void);
#if USE_HCACHE
if (!msgbegin)
- hc = mutt_hcache_open (HeaderCache, ctx->path);
+ hc = imap_hcache_open (idata, ctx->path);
if (hc)
{
return rc;
}
+#ifdef USE_HCACHE
+void* imap_hcache_open (IMAP_DATA* idata, const char* path)
+{
+ IMAP_MBOX mx;
+ ciss_url_t url;
+ char cachepath[LONG_STRING];
+
+ if (imap_parse_path (path, &mx) < 0)
+ return NULL;
+
+ mutt_account_tourl (&idata->conn->account, &url);
+ url.path = mx.mbox;
+ url_ciss_tostring (&url, cachepath, sizeof (cachepath), 0);
+ FREE (&mx.mbox);
+
+ return mutt_hcache_open (HeaderCache, cachepath);
+}
+#endif
+
/* imap_parse_path: given an IMAP mailbox name, return host, port
* and a path IMAP servers will recognise.
* mx.mbox is malloc'd, caller must free it */