From f909a998949fd49da85a63df07431cb7684fba6d Mon Sep 17 00:00:00 2001 From: Not Zed Date: Mon, 15 Jul 2002 02:11:16 +0000 Subject: Only assign a uid if indexing is enabled. This stops us always assigning a 2002-07-13 Not Zed * camel-folder-summary.c (camel_folder_summary_info_new_from_message): Only assign a uid if indexing is enabled. This stops us always assigning a uid in the imap folder and disco folder? * providers/imap/camel-imap-folder.c (imap_update_summary): Also check the uid is set at all, another bit of a fix for #15667. 2002-07-09 Not Zed * providers/imap/camel-imap-folder.c (imap_update_summary): Check for existing messages of the same uid before doing anything. If it exists, do nothing (perhaps it should merge?). A dirty hack for #15667. svn path=/trunk/; revision=17450 --- camel/providers/imap/camel-imap-folder.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'camel/providers') diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c index 174a551a99..a437024991 100644 --- a/camel/providers/imap/camel-imap-folder.c +++ b/camel/providers/imap/camel-imap-folder.c @@ -1964,7 +1964,7 @@ imap_update_summary (CamelFolder *folder, int exists, int i, seq, first, size, got; CamelImapResponseType type; const char *header_spec; - CamelMessageInfo *mi; + CamelMessageInfo *mi, *info; CamelStream *stream; char *uid, *resp; GData *data; @@ -2186,6 +2186,19 @@ imap_update_summary (CamelFolder *folder, int exists, g_warning ("No information for message %d", i + first); continue; } + uid = (char *)camel_message_info_uid(mi); + if (uid[0] == 0) { + g_warning("Server provided no uid: message %d", i + first); + continue; + } + info = camel_folder_summary_uid(folder->summary, uid); + if (info) { + g_warning("Message already present? %s", camel_message_info_uid(mi)); + camel_folder_summary_info_free(folder->summary, info); + camel_folder_summary_info_free(folder->summary, mi); + continue; + } + camel_folder_summary_add (folder->summary, mi); camel_folder_change_info_add_uid (changes, camel_message_info_uid (mi)); -- cgit v1.2.3