[geary] Fix namespace error listing "[GMail]" mailbox. Bug 790544.



commit a46feb24af2c1662f5401368f32e781405340930
Author: Michael James Gratton <mike vee net>
Date:   Sun Nov 19 21:49:45 2017 +1100

    Fix namespace error listing "[GMail]" mailbox. Bug 790544.
    
    Thanks to Torben for bug report and inital patch.
    
    * src/engine/imap/transport/imap-client-session.vala
      (ImapClientSession::get_delimiter_for_path): If the folder root does
      not exist as a namespace, look for an empty namespace, then default to
      the personal namespace.

 src/engine/imap/transport/imap-client-session.vala |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/src/engine/imap/transport/imap-client-session.vala 
b/src/engine/imap/transport/imap-client-session.vala
index 99456b0..32e2a89 100644
--- a/src/engine/imap/transport/imap-client-session.vala
+++ b/src/engine/imap/transport/imap-client-session.vala
@@ -494,9 +494,17 @@ public class Geary.Imap.ClientSession : BaseObject {
             delim = this.inbox.delim;
         } else {
             Namespace? ns = this.namespaces.get(root.basename);
-            if (ns != null) {
-                delim = ns.delim;
+            if (ns == null) {
+                // Folder's root doesn't exist as a namespace, so try
+                // the empty namespace.
+                ns = this.namespaces.get("");
+                if (ns == null) {
+                    // If that doesn't exist, fall back to the default
+                    // personal namespace
+                    ns = this.personal_namespaces[0];
+                }
             }
+            delim = ns.delim;
         }
         return delim;
     }


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