HEADER* h;
int i, cacheno;
+#if USE_HCACHE
+ void* hc;
+ char uidbuf[32];
+
+ hc = mutt_hcache_open (HeaderCache, idata->ctx->path);
+#endif
+
for (i = 0; i < idata->ctx->msgcount; i++)
{
h = idata->ctx->hdrs[i];
h->active = 0;
- /* free cached body from disk, if neccessary */
+#if USE_HCACHE
+ if (hc)
+ {
+ sprintf (uidbuf, "/%u", HEADER_DATA(h)->uid);
+ mutt_hcache_delete (hc, uidbuf, imap_hcache_keylen);
+ }
+#endif
+
+ /* free cached body from disk, if necessary */
cacheno = HEADER_DATA(h)->uid % IMAP_CACHE_LEN;
if (idata->cache[cacheno].uid == HEADER_DATA(h)->uid &&
idata->cache[cacheno].path)
}
}
+#if USE_HCACHE
+ mutt_hcache_close (hc);
+#endif
+
/* We may be called on to expunge at any time. We can't rely on the caller
* to always know to rethread */
mx_update_tables (idata->ctx, 0);
void imap_utf7_encode (char **s);
void imap_utf7_decode (char **s);
+#if USE_HCACHE
+static size_t imap_hcache_keylen (const char *fn)
+{
+ return mutt_strlen(fn);
+}
+#endif /* USE_HCACHE */
+
#endif
static int msg_parse_fetch (IMAP_HEADER* h, char* s);
static char* msg_parse_flags (IMAP_HEADER* h, char* s);
-#if USE_HCACHE
-static size_t imap_hcache_keylen (const char *fn);
-#endif /* USE_HCACHE */
-
/* imap_read_headers:
* Changed to read many headers instead of just one. It will return the
* msgno of the last message read. It will return a value other than
idata->newMailCount = 0;
#if USE_HCACHE
- hc = mutt_hcache_open (HeaderCache, ctx->path);
+ if (!msgbegin)
+ hc = mutt_hcache_open (HeaderCache, ctx->path);
if (hc) {
snprintf (buf, sizeof (buf),
return rc;
}
-#if USE_HCACHE
-static size_t imap_hcache_keylen (const char *fn)
-{
- return mutt_strlen(fn);
-}
-#endif /* USE_HCACHE */
-
/* msg_parse_fetch: handle headers returned from header fetch */
static int msg_parse_fetch (IMAP_HEADER *h, char *s)
{