From b2512674a0f8ccb34b631c16c3c24fdc201c9f12 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Fri, 11 Jan 2002 23:47:29 +0000 Subject: Kludge around a bug in Exchange 5.5 that reports 2 messages with the same 2002-01-11 Jeffrey Stedfast * providers/imap/camel-imap-folder.c (imap_update_summary): Kludge around a bug in Exchange 5.5 that reports 2 messages with the same UID. Fixes bug #17694. Replaces the fix from yesterday. svn path=/trunk/; revision=15298 --- camel/ChangeLog | 6 ++++++ camel/providers/imap/camel-imap-folder.c | 26 ++++++++++++++++++++++++-- 2 files changed, 30 insertions(+), 2 deletions(-) (limited to 'camel') diff --git a/camel/ChangeLog b/camel/ChangeLog index 0747303c31..873a13f18e 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,9 @@ +2002-01-11 Jeffrey Stedfast + + * providers/imap/camel-imap-folder.c (imap_update_summary): Kludge + around a bug in Exchange 5.5 that reports 2 messages with the same + UID. Fixes bug #17694. Replaces the fix from yesterday. + 2002-01-10 Jeffrey Stedfast * providers/local/camel-local-folder.c: If PATH_MAX doesn't exist, diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c index 89082fded2..6939587f10 100644 --- a/camel/providers/imap/camel-imap-folder.c +++ b/camel/providers/imap/camel-imap-folder.c @@ -1853,8 +1853,30 @@ imap_update_summary (CamelFolder *folder, int exists, mi = messages->pdata[seq - first]; if (mi == NULL) { - g_datalist_clear (&data); - continue; + CamelMessageInfo *pmi = NULL; + int j; + + /* This is a kludge around a bug in Exchange + * 5.5 that sometimes claims multiple messages + * have the same UID. See bug #17694 for + * details. The "solution" is to create a fake + * message-info with the same details as the + * previously valid message. Yes, the user + * will have a clone in his/her message-list, + * but at least we don't crash. + */ + + /* find the previous valid message info */ + for (j = seq - first - 1; j >= 0; j--) { + pmi = messages->pdata[j]; + if (pmi != NULL) + break; + } + + g_assert (pmi); + + mi = camel_message_info_new (); + camel_message_info_dup_to (pmi, mi); } uid = g_datalist_get_data (&data, "UID"); -- cgit v1.2.3