ignore \Recent, as it is voided by the syncronization run itself.

This commit is contained in:
Oswald Buddenhagen 2003-02-27 18:43:16 +00:00
parent e68fc4b463
commit 8fa6cd3346

View File

@ -82,7 +82,9 @@ sync_mailbox (mailbox_t * mbox, imap_t * imap, int flags,
/* if the UIDVALIDITY value has changed, it means all our /* if the UIDVALIDITY value has changed, it means all our
* local UIDs are invalid, so we can't sync. * local UIDs are invalid, so we can't sync.
*/ */
fputs ("ERROR: UIDVALIDITY changed on server (fatal)\n", stderr); fprintf (stderr,
"ERROR: UIDVALIDITY of '%s' changed on server\n",
imap->box->box);
return -1; return -1;
} }
} }
@ -219,21 +221,18 @@ sync_mailbox (mailbox_t * mbox, imap_t * imap, int flags,
*/ */
if ((cur->flags & D_DELETED) == 0 || (flags & SYNC_EXPUNGE) == 0) if ((cur->flags & D_DELETED) == 0 || (flags & SYNC_EXPUNGE) == 0)
{ {
size_t sl;
/* generate old path */ /* generate old path */
snprintf (path, sizeof (path), "%s/%s/%s", snprintf (path, sizeof (path), "%s/%s/%s",
mbox->path, cur->new ? "new" : "cur", cur->file); mbox->path, cur->new ? "new" : "cur", cur->file);
/* truncate old flags (if present) */ /* generate new path */
p = strchr (cur->file, ':'); strcpy (newpath, path);
if (p) p = strchr (newpath, ':');
*p = 0; sl = p ? (size_t)(p - newpath) : strlen (newpath);
snprintf (newpath + sl, sizeof (newpath) - sl, ":2,%s%s%s%s",
/* generate new path - always put this in the cur/ directory (cur->flags & D_FLAGGED) ? "F" : "",
* because its no longer new
*/
snprintf (newpath, sizeof (newpath), "%s/cur/%s:2,%s%s%s%s",
mbox->path,
cur->file, (cur->flags & D_FLAGGED) ? "F" : "",
(cur->flags & D_ANSWERED) ? "R" : "", (cur->flags & D_ANSWERED) ? "R" : "",
(cur->flags & D_SEEN) ? "S" : "", (cur->flags & D_SEEN) ? "S" : "",
(cur->flags & D_DELETED) ? "T" : ""); (cur->flags & D_DELETED) ? "T" : "");
@ -249,7 +248,6 @@ sync_mailbox (mailbox_t * mbox, imap_t * imap, int flags,
p = strrchr (newpath, '/'); p = strrchr (newpath, '/');
free (cur->file); free (cur->file);
cur->file = strdup (p + 1); cur->file = strdup (p + 1);
cur->new = 0; /* not any more */
} }
} }
} }
@ -314,7 +312,7 @@ sync_mailbox (mailbox_t * mbox, imap_t * imap, int flags,
/* construct the flags part of the file name. */ /* construct the flags part of the file name. */
*suffix = 0; *suffix = 0;
if (cur->flags & ~D_RECENT) if (cur->flags & ~(D_RECENT | D_DRAFT))
{ {
snprintf (suffix, sizeof (suffix), ":2,%s%s%s%s", snprintf (suffix, sizeof (suffix), ":2,%s%s%s%s",
(cur->flags & D_FLAGGED) ? "F" : "", (cur->flags & D_FLAGGED) ? "F" : "",
@ -363,7 +361,7 @@ sync_mailbox (mailbox_t * mbox, imap_t * imap, int flags,
p = strrchr (path, '/'); p = strrchr (path, '/');
snprintf (newpath, sizeof (newpath), "%s/%s%s", mbox->path, snprintf (newpath, sizeof (newpath), "%s/%s%s", mbox->path,
(cur->flags & ~D_RECENT) ? "cur" : "new", p); (cur->flags & D_SEEN) ? "cur" : "new", p); /* hack: ignore \recent, use !\seen instead */
/* its ok if this fails, the next time we sync the message /* its ok if this fails, the next time we sync the message
* will get pulled down * will get pulled down