From 0739243df1de03712395d29001efc6a0613231b9 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Thu, 17 Jun 2004 03:11:23 +0000 Subject: Only force a re-update of all FLAGS if this folder wasn't in the SELECTED 2004-06-16 Jeffrey Stedfast * providers/imap4/camel-imap4-folder.c (imap4_refresh_info): Only force a re-update of all FLAGS if this folder wasn't in the SELECTED state. Otherwise, simply send a NOOP. svn path=/trunk/; revision=26372 --- camel/ChangeLog | 4 ++++ camel/providers/imap4/camel-imap4-folder.c | 20 +++++++++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) (limited to 'camel') diff --git a/camel/ChangeLog b/camel/ChangeLog index bad3959169..447a1cc93f 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,5 +1,9 @@ 2004-06-16 Jeffrey Stedfast + * providers/imap4/camel-imap4-folder.c (imap4_refresh_info): Only + force a re-update of all FLAGS if this folder wasn't in the + SELECTED state. Otherwise, simply send a NOOP. + * providers/imap4/camel-imap4-summary.c: Added a 'first' member to the imap_fetch_all_t struct so we can use that as a base offset in our GPtrArray, allowing us to limit resource consumption which diff --git a/camel/providers/imap4/camel-imap4-folder.c b/camel/providers/imap4/camel-imap4-folder.c index 5e234a0d6f..fb47d3f994 100644 --- a/camel/providers/imap4/camel-imap4-folder.c +++ b/camel/providers/imap4/camel-imap4-folder.c @@ -597,17 +597,31 @@ imap4_refresh_info (CamelFolder *folder, CamelException *ex) { CamelIMAP4Engine *engine = ((CamelIMAP4Store *) folder->parent_store)->engine; CamelFolder *selected = (CamelFolder *) engine->folder; + CamelIMAP4Command *ic; + int id; CAMEL_SERVICE_LOCK (folder->parent_store, connect_lock); if (folder != selected) { if (camel_imap4_engine_select_folder (engine, folder, ex) == -1) goto done; + + ((CamelIMAP4Summary *) folder->summary)->update_flags = TRUE; + } else { + ic = camel_imap4_engine_queue (engine, NULL, "NOOP\r\n"); + while ((id = camel_imap4_engine_iterate (engine)) < ic->id && id != -1) + ; + + if (id == -1 || ic->status != CAMEL_IMAP4_COMMAND_COMPLETE) + camel_exception_xfer (ex, &ic->ex); + + camel_imap4_command_unref (ic); + + if (camel_exception_is_set (ex)) + goto done; } - ((CamelIMAP4Summary *) folder->summary)->update_flags = TRUE; - if (camel_imap4_summary_flush_updates (folder->summary, ex) == -1) - goto done; + camel_imap4_summary_flush_updates (folder->summary, ex); done: -- cgit v1.2.3