From 3e94f5100cae141d1944b0c1cf9577a59a3ce281 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Sat, 12 Jun 2004 17:27:51 +0000 Subject: Flush summary updates for the currently selected folder. (imap4_noop): 2004-06-12 Jeffrey Stedfast * 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. svn path=/trunk/; revision=26324 --- camel/ChangeLog | 2 ++ camel/providers/imap4/camel-imap4-store.c | 13 +++++++++++-- 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); } -- cgit v1.2.3