+2007-03-28 09:43 +0200 Thomas Roessler <roessler@does-not-exist.org> (25cbd5588d35)
+
+ * alias.c: Fix debug message for mutt_adr_is_user
+
+2007-03-23 10:32 -0700 Brendan Cully <brendan@kublai.com> (888a57a2b5f2)
+
+ * imap/browse.c: Reset list.name before each list response in
+ folder browser
+
2007-03-22 14:36 +0100 Thomas Roessler <roessler@does-not-exist.org> (68cfab02b411)
* curs_main.c: Fix update_index().
return fp;
}
+int mutt_bcache_move(body_cache_t* bcache, const char* id, const char* newid)
+{
+ char path[_POSIX_PATH_MAX];
+ char newpath[_POSIX_PATH_MAX];
+
+ if (!bcache || !id || !*id || !newid || !*newid)
+ return -1;
+
+ snprintf (path, sizeof (path), "%s%s", bcache->path, id);
+ snprintf (newpath, sizeof (newpath), "%s%s", bcache->path, newid);
+
+ dprint (3, (debugfile, "bcache: mv: '%s' '%s'\n", path, newpath));
+
+ return rename (path, newpath);
+}
+
int mutt_bcache_del(body_cache_t *bcache, const char *id)
{
char path[_POSIX_PATH_MAX];
FILE* mutt_bcache_get(body_cache_t *bcache, const char *id);
FILE* mutt_bcache_put(body_cache_t *bcache, const char *id);
+int mutt_bcache_move(body_cache_t *bcache, const char *id, const char *newid);
int mutt_bcache_del(body_cache_t *bcache, const char *id);
int mutt_bcache_exists(body_cache_t *bcache, const char *id);
static FILE* msg_cache_get (IMAP_DATA* idata, HEADER* h);
static FILE* msg_cache_put (IMAP_DATA* idata, HEADER* h);
+static int msg_cache_commit (IMAP_DATA* idata, HEADER* h);
static void flush_buffer(char* buf, size_t* len, CONNECTION* conn);
static int msg_fetch_header (CONTEXT* ctx, IMAP_HEADER* h, char* buf,
if (!fetched || !imap_code (idata->buf))
goto bail;
-parsemsg:
+ msg_cache_commit (idata, h);
+
+ parsemsg:
/* Update the header information. Previously, we only downloaded a
* portion of the headers, those required for the main display.
*/
return NULL;
idata->bcache = msg_cache_open (idata);
- snprintf (id, sizeof (id), "%u-%u", idata->uid_validity, HEADER_DATA(h)->uid);
+ snprintf (id, sizeof (id), "%u-%u.tmp", idata->uid_validity, HEADER_DATA(h)->uid);
return mutt_bcache_put (idata->bcache, id);
}
+static int msg_cache_commit (IMAP_DATA* idata, HEADER* h)
+{
+ char id[_POSIX_PATH_MAX];
+ char newid[_POSIX_PATH_MAX];
+
+ if (!idata || !h)
+ return -1;
+
+ idata->bcache = msg_cache_open (idata);
+ snprintf (id, sizeof (id), "%u-%u.tmp", idata->uid_validity, HEADER_DATA(h)->uid);
+ snprintf (newid, sizeof (newid), "%u-%u", idata->uid_validity, HEADER_DATA(h)->uid);
+
+ return mutt_bcache_move (idata->bcache, id, newid);
+}
+
int imap_cache_del (IMAP_DATA* idata, HEADER* h)
{
char id[_POSIX_PATH_MAX];