[geary/mjog/prefer-special-use: 1/2] Geary.Imap.AccountSession: Prefer SPECIAL-USE over XLIST



commit e4061b839b573abfa87c725080efd8862ae7eaba
Author: Michael Gratton <mike vee net>
Date:   Tue Mar 17 22:10:18 2020 +1100

    Geary.Imap.AccountSession: Prefer SPECIAL-USE over XLIST
    
    The latter is an old, proprietary Gmail extension, we should be
    preferring the standard over it.

 src/engine/imap/api/imap-account-session.vala | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/src/engine/imap/api/imap-account-session.vala b/src/engine/imap/api/imap-account-session.vala
index ed713733..4f7f99d6 100644
--- a/src/engine/imap/api/imap-account-session.vala
+++ b/src/engine/imap/api/imap-account-session.vala
@@ -308,20 +308,21 @@ internal class Geary.Imap.AccountSession : Geary.Imap.SessionObject {
                                                                bool list_children,
                                                                Cancellable? cancellable)
         throws Error {
-        bool can_xlist = session.capabilities.has_capability(Capabilities.XLIST);
-
-        // Request SPECIAL-USE if available and not using XLIST
+        // Request SPECIAL-USE or else XLIST if available
         ListReturnParameter? return_param = null;
-        if (session.capabilities.supports_special_use() && !can_xlist) {
+        bool use_xlist = false;
+        if (session.capabilities.supports_special_use()) {
             return_param = new ListReturnParameter();
             return_param.add_special_use();
+        } else {
+            use_xlist = session.capabilities.has_capability(Capabilities.XLIST);
         }
 
         ListCommand cmd;
         if (folder.is_root) {
             // List the server root
             cmd = new ListCommand.wildcarded(
-                "", new MailboxSpecifier("%"), can_xlist, return_param
+                "", new MailboxSpecifier("%"), use_xlist, return_param
             );
         } else {
             // List either the given folder or its children
@@ -333,7 +334,7 @@ internal class Geary.Imap.AccountSession : Geary.Imap.SessionObject {
                 }
                 specifier = specifier + delim + "%";
             }
-            cmd = new ListCommand(new MailboxSpecifier(specifier), can_xlist, return_param);
+            cmd = new ListCommand(new MailboxSpecifier(specifier), use_xlist, return_param);
         }
 
         Gee.List<MailboxInformation> list_results = new Gee.ArrayList<MailboxInformation>();


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