[geary/wip/181-special-folder-dupes: 1/3] fixup



commit 5e6ecb831ea9bfcf8895d10d1f86766caea69219
Author: Michael Gratton <mike vee net>
Date:   Mon Jan 14 17:30:06 2019 +1100

    fixup

 src/engine/imap-engine/imap-engine-generic-account.vala |  5 ++++-
 src/engine/imap/api/imap-account-session.vala           | 17 +++++++++--------
 src/engine/imap/message/imap-mailbox-specifier.vala     |  6 ++++--
 3 files changed, 17 insertions(+), 11 deletions(-)
---
diff --git a/src/engine/imap-engine/imap-engine-generic-account.vala 
b/src/engine/imap-engine/imap-engine-generic-account.vala
index 48e0697c..dd3a08fc 100644
--- a/src/engine/imap-engine/imap-engine-generic-account.vala
+++ b/src/engine/imap-engine/imap-engine-generic-account.vala
@@ -1153,7 +1153,10 @@ internal class Geary.ImapEngine.UpdateRemoteFolders : AccountOperation {
         );
         try {
             bool is_suspect = yield enumerate_remote_folders_async(
-                remote, remote_folders, null, cancellable
+                remote,
+                remote_folders,
+                account.local.imap_folder_root,
+                cancellable
             );
 
             // pair the local and remote folders and make sure
diff --git a/src/engine/imap/api/imap-account-session.vala b/src/engine/imap/api/imap-account-session.vala
index 99645990..45358e3f 100644
--- a/src/engine/imap/api/imap-account-session.vala
+++ b/src/engine/imap/api/imap-account-session.vala
@@ -161,17 +161,18 @@ internal class Geary.Imap.AccountSession : Geary.Imap.SessionObject {
     /**
      * Returns a list of children of the given folder.
      *
-     * If the parent folder is `null`, then the root of the server
-     * will be listed.
-     *
      * This method will perform a pipe-lined IMAP SELECT for all
      * folders found, and hence should be used with care.
      */
-    public async Gee.List<Imap.Folder> fetch_child_folders_async(FolderPath? parent, Cancellable? 
cancellable)
-        throws Error {
+    public async Gee.List<Folder>
+        fetch_child_folders_async(FolderPath parent,
+                                  GLib.Cancellable? cancellable)
+        throws GLib.Error {
         ClientSession session = claim_session();
         Gee.List<Imap.Folder> children = new Gee.ArrayList<Imap.Folder>();
-        Gee.List<MailboxInformation> mailboxes = yield send_list_async(session, parent, true, cancellable);
+        Gee.List<MailboxInformation> mailboxes = yield send_list_async(
+            session, parent, true, cancellable
+        );
         if (mailboxes.size == 0) {
             return children;
         }
@@ -295,7 +296,7 @@ internal class Geary.Imap.AccountSession : Geary.Imap.SessionObject {
 
     // Performs a LIST against the server, returning the results
     private async Gee.List<MailboxInformation> send_list_async(ClientSession session,
-                                                               FolderPath? folder,
+                                                               FolderPath folder,
                                                                bool list_children,
                                                                Cancellable? cancellable)
         throws Error {
@@ -309,7 +310,7 @@ internal class Geary.Imap.AccountSession : Geary.Imap.SessionObject {
         }
 
         ListCommand cmd;
-        if (folder == null) {
+        if (folder.is_root) {
             // List the server root
             cmd = new ListCommand.wildcarded(
                 "", new MailboxSpecifier("%"), can_xlist, return_param
diff --git a/src/engine/imap/message/imap-mailbox-specifier.vala 
b/src/engine/imap/message/imap-mailbox-specifier.vala
index ad6f638e..fb325676 100644
--- a/src/engine/imap/message/imap-mailbox-specifier.vala
+++ b/src/engine/imap/message/imap-mailbox-specifier.vala
@@ -208,10 +208,12 @@ public class Geary.Imap.MailboxSpecifier : BaseObject, Gee.Hashable<MailboxSpeci
 
         // If the first element is same as supplied inbox specifier,
         // use canonical inbox name, otherwise keep
-        FolderPath? path =
+        FolderPath? path = (
             (inbox_specifier != null && list[0] == inbox_specifier.name)
             ? root.get_child(CANONICAL_INBOX_NAME)
-            : root.get_child(list[0]);
+            : root.get_child(list[0])
+        );
+        list.remove_at(0);
 
         foreach (string name in list) {
             path = path.get_child(name);


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