aboutsummaryrefslogtreecommitdiffstats
path: root/camel
diff options
context:
space:
mode:
Diffstat (limited to 'camel')
-rw-r--r--camel/ChangeLog2
-rw-r--r--camel/providers/imap4/camel-imap4-store.c13
2 files changed, 13 insertions, 2 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 3fa2d5bfbd..402c331b9f 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -2,6 +2,8 @@
* providers/imap4/camel-imap4-store.c (imap4_noop): Flush summary
updates for the currently selected folder.
+ (imap4_noop): Sync the currently selected folder before sending
+ NOOP.
* providers/imap4/camel-imap4-summary.c
(camel_imap4_summary_set_exists): Don't bother with
diff --git a/camel/providers/imap4/camel-imap4-store.c b/camel/providers/imap4/camel-imap4-store.c
index e9dcd66288..518b8ab137 100644
--- a/camel/providers/imap4/camel-imap4-store.c
+++ b/camel/providers/imap4/camel-imap4-store.c
@@ -1301,11 +1301,20 @@ static void
imap4_noop (CamelStore *store, CamelException *ex)
{
CamelIMAP4Engine *engine = ((CamelIMAP4Store *) store)->engine;
+ CamelFolder *folder = (CamelFolder *) engine->folder;
CamelIMAP4Command *ic;
int id;
CAMEL_SERVICE_LOCK (store, connect_lock);
+ if (folder) {
+ camel_folder_sync (folder, FALSE, ex);
+ if (camel_exception_is_set (ex)) {
+ CAMEL_SERVICE_UNLOCK (store, connect_lock);
+ return;
+ }
+ }
+
ic = camel_imap4_engine_queue (engine, NULL, "NOOP\r\n");
while ((id = camel_imap4_engine_iterate (engine)) < ic->id && id != -1)
;
@@ -1315,8 +1324,8 @@ imap4_noop (CamelStore *store, CamelException *ex)
camel_imap4_command_unref (ic);
- if (engine->folder && !camel_exception_is_set (ex))
- camel_imap4_summary_flush_updates (((CamelFolder *) engine->folder)->summary, ex);
+ if (folder && !camel_exception_is_set (ex))
+ camel_imap4_summary_flush_updates (folder->summary, ex);
CAMEL_SERVICE_UNLOCK (store, connect_lock);
}