[geary] Fixes IMAP error causing all remote folders to be considered deleted



commit 1256d81dbd48da0d562c64582c1115bcf75b4b82
Author: Jim Nelson <jim yorba org>
Date:   Wed Jan 29 11:06:32 2014 -0800

    Fixes IMAP error causing all remote folders to be considered deleted

 .../imap-engine/imap-engine-generic-account.vala   |    4 ++--
 src/engine/imap/api/imap-account.vala              |    4 ++++
 2 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/engine/imap-engine/imap-engine-generic-account.vala 
b/src/engine/imap-engine/imap-engine-generic-account.vala
index 18e99af..87684bd 100644
--- a/src/engine/imap-engine/imap-engine-generic-account.vala
+++ b/src/engine/imap-engine/imap-engine-generic-account.vala
@@ -360,8 +360,8 @@ private abstract class Geary.ImapEngine.GenericAccount : Geary.AbstractAccount {
         try {
             remote_children = yield remote.list_child_folders_async(parent, cancellable);
         } catch (Error err) {
-            // ignore everything but I/O errors
-            if (err is IOError)
+            // ignore everything but I/O and IMAP errors (cancellation is an IOError)
+            if (err is IOError || err is ImapError)
                 throw err;
         }
         
diff --git a/src/engine/imap/api/imap-account.vala b/src/engine/imap/api/imap-account.vala
index 0cd39c4..9f07277 100644
--- a/src/engine/imap/api/imap-account.vala
+++ b/src/engine/imap/api/imap-account.vala
@@ -244,6 +244,10 @@ private class Geary.Imap.Account : BaseObject {
                 mailbox_info.mailbox);
         }
         
+        // if no STATUS results are needed, bail out with what's been collected
+        if (cmd_map.size == 0)
+            return child_folders;
+        
         Gee.List<StatusData> status_results = new Gee.ArrayList<StatusData>();
         Gee.Map<Command, StatusResponse> responses = yield send_multiple_async(cmd_map.keys,
             null, status_results, cancellable);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]