From 26db788bff672e61505b18df26e491a7a0000f84 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Fri, 11 Jun 2004 06:08:04 +0000 Subject: (camel_imap4_summary_flush_updates): Added some logic to distinguish between EXISTS value changing because it changed and because messages got expunged. svn path=/trunk/; revision=26302 --- camel/providers/imap4/camel-imap4-summary.c | 7 +++++++ camel/providers/imap4/camel-imap4-summary.h | 1 + 2 files changed, 8 insertions(+) (limited to 'camel/providers') diff --git a/camel/providers/imap4/camel-imap4-summary.c b/camel/providers/imap4/camel-imap4-summary.c index 70a92a1d1a..fa7cd7778a 100644 --- a/camel/providers/imap4/camel-imap4-summary.c +++ b/camel/providers/imap4/camel-imap4-summary.c @@ -1065,6 +1065,8 @@ camel_imap4_summary_expunge (CamelFolderSummary *summary, int seqid) if (!(info = camel_folder_summary_index (summary, seqid - 1))) return; + imap4_summary->expunged_changed = TRUE; + changes = camel_folder_change_info_new (); camel_folder_change_info_remove_uid (changes, camel_message_info_uid (info)); camel_object_trigger_event (imap4_summary->folder, "folder_changed", changes); @@ -1102,6 +1104,11 @@ camel_imap4_summary_flush_updates (CamelFolderSummary *summary, CamelException * engine = ((CamelIMAP4Store *) imap4_summary->folder->parent_store)->engine; + if (imap4_summary->expunged_changed && imap4_summary->exists_changed) { + if (imap4_summary->exists == camel_folder_summary_count (summary)) + imap4_summary->exists_changed = FALSE; + } + if (imap4_summary->uidvalidity_changed) { first = 1; } else if (imap4_summary->exists_changed && imap4_summary->exists > 0) { diff --git a/camel/providers/imap4/camel-imap4-summary.h b/camel/providers/imap4/camel-imap4-summary.h index 6b5e906960..9546a7923d 100644 --- a/camel/providers/imap4/camel-imap4-summary.h +++ b/camel/providers/imap4/camel-imap4-summary.h @@ -60,6 +60,7 @@ struct _CamelIMAP4Summary { guint32 uidvalidity; guint uidvalidity_changed:1; + guint expunged_changed; guint exists_changed:1; }; -- cgit v1.2.3