| 1592 | | |
| 1593 | | return NULL; |
| | 1601 | status = NULL; |
| | 1602 | |
| | 1603 | #ifdef USE_HCACHE |
| | 1604 | path = safe_strdup (idata->ctx->path); |
| | 1605 | url_parse_ciss (&url, path); |
| | 1606 | url.path = (char*)mbox; |
| | 1607 | url_ciss_tostring (&url, urlstr, sizeof (urlstr), 0); |
| | 1608 | FREE (&path); |
| | 1609 | hc = mutt_hcache_open (HeaderCache, urlstr); |
| | 1610 | if (hc) |
| | 1611 | { |
| | 1612 | uidvalidity = mutt_hcache_fetch_raw (hc, "/UIDVALIDITY", imap_hcache_keylen); |
| | 1613 | uidnext = mutt_hcache_fetch_raw (hc, "/UIDNEXT", imap_hcache_keylen); |
| | 1614 | if (uidvalidity) |
| | 1615 | { |
| | 1616 | /* lame */ |
| | 1617 | memset (&scache, 0, sizeof (scache)); |
| | 1618 | scache.name = (char*)mbox; |
| | 1619 | idata->mboxcache = mutt_add_list_n (idata->mboxcache, &scache, |
| | 1620 | sizeof (scache)); |
| | 1621 | status = imap_mboxcache_get (idata, mbox); |
| | 1622 | status->name = safe_strdup (mbox); |
| | 1623 | status->uidvalidity = *uidvalidity; |
| | 1624 | status->uidnext = uidnext ? *uidnext: 0; |
| | 1625 | dprint (3, (debugfile, "mboxcache: hcache uidvalidity %d, uidnext %d\n", |
| | 1626 | status->uidvalidity, status->uidnext)); |
| | 1627 | } |
| | 1628 | FREE (&uidvalidity); |
| | 1629 | FREE (&uidnext); |
| | 1630 | mutt_hcache_close (hc); |
| | 1631 | } |
| | 1632 | #endif |
| | 1633 | |
| | 1634 | return status; |