aboutsummaryrefslogtreecommitdiffstats
path: root/camel
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2000-07-06 03:42:32 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2000-07-06 03:42:32 +0800
commit0837fc409943cafbf57dcd51525b9b7f68148639 (patch)
treebce40c01ff35049703f704e01f09262818e74f87 /camel
parent095903c7d3c4028aec99f4cdc23149e1fed81fa6 (diff)
downloadgsoc2013-evolution-0837fc409943cafbf57dcd51525b9b7f68148639.tar
gsoc2013-evolution-0837fc409943cafbf57dcd51525b9b7f68148639.tar.gz
gsoc2013-evolution-0837fc409943cafbf57dcd51525b9b7f68148639.tar.bz2
gsoc2013-evolution-0837fc409943cafbf57dcd51525b9b7f68148639.tar.lz
gsoc2013-evolution-0837fc409943cafbf57dcd51525b9b7f68148639.tar.xz
gsoc2013-evolution-0837fc409943cafbf57dcd51525b9b7f68148639.tar.zst
gsoc2013-evolution-0837fc409943cafbf57dcd51525b9b7f68148639.zip
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
Diffstat (limited to 'camel')
-rw-r--r--camel/ChangeLog16
-rw-r--r--camel/camel-folder-summary.c9
-rw-r--r--camel/providers/mbox/camel-mbox-folder.c1
-rw-r--r--camel/providers/mbox/camel-mbox-summary.c15
4 files changed, 23 insertions, 18 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 12a3122c8e..8d41999209 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,19 @@
+2000-07-05 Ettore Perazzoli <ettore@helixcode.com>
+
+ * providers/mbox/camel-mbox-summary.c (camel_mbox_summary_sync):
+ Update the X-Evolution: header even if the in-memory UID and the
+ saved UID are not the same. Otherwise mboxes with clashing UIDs
+ can never be fixed.
+
+ * camel-folder-summary.c
+ (camel_folder_summary_add_from_parser): Add the message to the
+ summary before doing any ibex stuff. In fact, this might also
+ have the side effect of reassigning the UID so it needs to be done
+ before we start using the UID.
+
+ * providers/mbox/camel-mbox-folder.c (mbox_append_message): Add
+ debugging message to keep track of the UIDs we add.
+
2000-07-05 Dan Winship <danw@helixcode.com>
* camel-folder-summary.c: Add "Cc" to summary and bump summary
diff --git a/camel/camel-folder-summary.c b/camel/camel-folder-summary.c
index 2bb7ca2a74..027984e7ef 100644
--- a/camel/camel-folder-summary.c
+++ b/camel/camel-folder-summary.c
@@ -421,7 +421,7 @@ retry:
info->uid = camel_folder_summary_next_uid_string (s);
}
if (g_hash_table_lookup(s->messages_uid, info->uid)) {
- g_warning("Trying to insert message with clashing uid. new uid re-assigned");
+ g_warning("Trying to insert message with clashing uid (%s). new uid re-assigned", info->uid);
g_free(info->uid);
info->uid = NULL;
info->flags |= CAMEL_MESSAGE_FOLDER_FLAGGED;
@@ -457,10 +457,7 @@ CamelMessageInfo *camel_folder_summary_add_from_parser(CamelFolderSummary *s, Ca
camel_mime_parser_unstep(mp);
- /* FIXME: better uid assignment method? */
- if (info->uid == NULL) {
- info->uid = camel_folder_summary_next_uid_string (s);
- }
+ camel_folder_summary_add(s, info);
if (p->index) {
if (p->filter_index == NULL)
@@ -477,8 +474,6 @@ CamelMessageInfo *camel_folder_summary_add_from_parser(CamelFolderSummary *s, Ca
} else {
camel_mime_parser_drop_step(mp);
}
-
- camel_folder_summary_add(s, info);
}
return info;
}
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) {