aboutsummaryrefslogtreecommitdiffstats
path: root/camel
diff options
context:
space:
mode:
Diffstat (limited to 'camel')
-rw-r--r--camel/ChangeLog3
-rw-r--r--camel/providers/imap4/camel-imap4-summary.c7
-rw-r--r--camel/providers/imap4/camel-imap4-summary.h1
3 files changed, 11 insertions, 0 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 1b4b290185..cb94e4a994 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -15,6 +15,9 @@
were removed or otherwise updated.
(camel_imap4_summary_expunge): Use seqid-1 to determine the actual
summary index.
+ (camel_imap4_summary_flush_updates): Added some logic to
+ distinguish between EXISTS value changing because it changed and
+ because messages got expunged.
* providers/imap4/camel-imap4-folder.c (imap4_sync): Flush updates
after an EXPUNGE and don't unset expunge if we didn't delete
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;
};