aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2004-06-17 11:11:23 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2004-06-17 11:11:23 +0800
commit0739243df1de03712395d29001efc6a0613231b9 (patch)
treec065191377d222397349959e35aa5374d6289c49
parent4318f82f0381150d57789dc9b707bf0ca448f0b3 (diff)
downloadgsoc2013-evolution-0739243df1de03712395d29001efc6a0613231b9.tar.gz
gsoc2013-evolution-0739243df1de03712395d29001efc6a0613231b9.tar.zst
gsoc2013-evolution-0739243df1de03712395d29001efc6a0613231b9.zip
Only force a re-update of all FLAGS if this folder wasn't in the SELECTED
2004-06-16 Jeffrey Stedfast <fejj@ximian.com> * 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
-rw-r--r--camel/ChangeLog4
-rw-r--r--camel/providers/imap4/camel-imap4-folder.c20
2 files changed, 21 insertions, 3 deletions
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 <fejj@ximian.com>
+ * 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: