From 0837fc409943cafbf57dcd51525b9b7f68148639 Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Wed, 5 Jul 2000 19:42:32 +0000 Subject: Fix the "clashing UIDs are not updated on disk" problem by syncing back to disk even if the saved UID does not match the in-memory UID and added some debugging messages. Also, make sure the UID we use for Ibex stuff is the new one when changing UIDs to solve a clashing problem. svn path=/trunk/; revision=3892 --- camel/providers/mbox/camel-mbox-folder.c | 1 + camel/providers/mbox/camel-mbox-summary.c | 15 ++++----------- 2 files changed, 5 insertions(+), 11 deletions(-) (limited to 'camel/providers') diff --git a/camel/providers/mbox/camel-mbox-folder.c b/camel/providers/mbox/camel-mbox-folder.c index 6efa93a42c..63d0d2cfb9 100644 --- a/camel/providers/mbox/camel-mbox-folder.c +++ b/camel/providers/mbox/camel-mbox-folder.c @@ -310,6 +310,7 @@ mbox_append_message (CamelFolder *folder, CamelMimeMessage *message, CamelExcept uid = camel_folder_summary_next_uid (CAMEL_FOLDER_SUMMARY (mbox_folder->summary)); xev = g_strdup_printf ("%08x-0000", uid); camel_medium_add_header (CAMEL_MEDIUM (message), "X-Evolution", xev); + g_print ("%s -- %s\n", __FUNCTION__, xev); g_free (xev); /* we must write this to the non-filtered stream ... */ diff --git a/camel/providers/mbox/camel-mbox-summary.c b/camel/providers/mbox/camel-mbox-summary.c index 90f13a7ff2..ebc607d9fa 100644 --- a/camel/providers/mbox/camel-mbox-summary.c +++ b/camel/providers/mbox/camel-mbox-summary.c @@ -672,19 +672,12 @@ camel_mbox_summary_sync (CamelMboxSummary *mbs, gboolean expunge, CamelException goto error; } - xev = camel_mime_parser_header (mp, "X-Evolution", &xevoffset); - if (xev && header_evolution_decode (xev, &uid, &flags) != -1) { - char name[64]; + /* Check if the X-Evolution header is valid. */ - sprintf (name, "%u", uid); - if (strcmp (name, info->info.uid)) { - d(printf ("Summary mismatch, aborting leaving mailbox intact\n")); - camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, - "Summary mismatch, aborting leaving mailbox intact"); - goto error; - } + xev = camel_mime_parser_header (mp, "X-Evolution", &xevoffset); + if (xev && header_evolution_decode (xev, &uid, &flags) != -1) xevok = TRUE; - } + xevnew = header_evolution_encode (strtoul (info->info.uid, NULL, 10), info->info.flags & 0xffff); if (quick) { if (!xevok) { -- cgit v1.2.3