From 36da2069e0746be7da3377010500c124a3f26a45 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Tue, 25 Sep 2001 23:09:45 +0000 Subject: The folder-info needs to take priority over the folder because of the way 2001-09-25 Jeffrey Stedfast * mail-folder-cache.c (update_1folder): The folder-info needs to take priority over the folder because of the way IMAP works (which is that it doesn't actually update the folders until you SELECT them and so when you do get_folder_info(), it doesn't actually SELECT the folders, it just STATUS's them). svn path=/trunk/; revision=13133 --- mail/ChangeLog | 8 ++++++++ mail/mail-folder-cache.c | 10 +++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/mail/ChangeLog b/mail/ChangeLog index 8f869194bb..344a50eaf4 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,11 @@ +2001-09-25 Jeffrey Stedfast + + * mail-folder-cache.c (update_1folder): The folder-info needs to + take priority over the folder because of the way IMAP works (which + is that it doesn't actually update the folders until you SELECT + them and so when you do get_folder_info(), it doesn't actually + SELECT the folders, it just STATUS's them). + 2001-09-25 * folder-browser.c (folder_browser_destroy): Deal with destroy vs diff --git a/mail/mail-folder-cache.c b/mail/mail-folder-cache.c index 90ab1a805b..b29b1e9fc4 100644 --- a/mail/mail-folder-cache.c +++ b/mail/mail-folder-cache.c @@ -83,10 +83,14 @@ update_1folder(struct _folder_info *mfi, CamelFolderInfo *info) LOCK(info_lock); folder = mfi->folder; if (folder) { - if (CAMEL_IS_VTRASH_FOLDER(folder) || folder == outbox_folder) + if (CAMEL_IS_VTRASH_FOLDER (folder) || folder == outbox_folder) { unread = camel_folder_get_message_count(folder); - else - unread = camel_folder_get_unread_message_count(folder); + } else { + if (info) + unread = (info->unread_message_count == -1) ? 0 : info->unread_message_count; + else + unread = camel_folder_get_unread_message_count (folder); + } } else if (info) unread = (info->unread_message_count==-1)?0:info->unread_message_count; UNLOCK(info_lock); -- cgit v1.2.3