[geary] Fix endless retry loop when selecting unselectable folder



commit b5eed80ea71495d95d9db122a29c9068d9f46060
Author: Jim Nelson <jim yorba org>
Date:   Tue May 27 15:57:30 2014 -0700

    Fix endless retry loop when selecting unselectable folder
    
    Discovered when selecting the [Gmail] folder, which is unselectable.

 src/engine/imap/api/imap-folder.vala |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/src/engine/imap/api/imap-folder.vala b/src/engine/imap/api/imap-folder.vala
index e853ae9..7fbbd2f 100644
--- a/src/engine/imap/api/imap-folder.vala
+++ b/src/engine/imap/api/imap-folder.vala
@@ -125,8 +125,17 @@ private class Geary.Imap.Folder : BaseObject {
             
             if (select_err != null)
                 throw select_err;
-            else
-                throw new ImapError.SERVER_ERROR("Unable to SELECT %s: %s", path.to_string(), 
response.to_string());
+            
+            switch (response.status) {
+                case Status.BAD:
+                case Status.NO:
+                    throw new ImapError.NOT_SUPPORTED("Server disallowed SELECT %s: %s", path.to_string(),
+                        response.to_string());
+                
+                default:
+                    throw new ImapError.SERVER_ERROR("Unable to SELECT %s: %s", path.to_string(),
+                        response.to_string());
+            }
         }
         
         // if at end of SELECT command accepts_user_flags is still UNKKNOWN, treat as TRUE because,


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