[geary/mjog/prefer-special-use: 23/23] console: Support issuing SPECIAL-USE with LIST commands



commit 8172ad960b0f999e013d93e3a8425b650ecdd24f
Author: Michael Gratton <mike vee net>
Date:   Tue Mar 17 22:10:23 2020 +1100

    console: Support issuing SPECIAL-USE with LIST commands

 src/console/main.vala | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)
---
diff --git a/src/console/main.vala b/src/console/main.vala
index b6fbcb0d..fcb6a320 100644
--- a/src/console/main.vala
+++ b/src/console/main.vala
@@ -423,11 +423,22 @@ class ImapConsole : Gtk.Window {
     }
 
     private void list(string cmd, string[] args) throws Error {
-        check_connected(cmd, args, 2, "<reference> <mailbox>");
+        check_min_connected(cmd, args, 2, "<reference> <mailbox> [special-use]");
 
         status("Listing...");
-        this.cx.send_command(new Geary.Imap.ListCommand.wildcarded(args[0],
-            new Geary.Imap.MailboxSpecifier(args[1]), (cmd.down() == "xlist"), null));
+        Geary.Imap.ListReturnParameter? return_param = null;
+        if (args.length >= 3 && args[2] == "special-use") {
+            return_param = new Geary.Imap.ListReturnParameter();
+            return_param.add_special_use();
+        }
+        this.cx.send_command(
+            new Geary.Imap.ListCommand.wildcarded(
+                args[0],
+                new Geary.Imap.MailboxSpecifier(args[1]),
+                (cmd.down() == "xlist"),
+                return_param
+            )
+        );
     }
 
     private void examine(string cmd, string[] args) throws Error {


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