]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
doveadm mailbox status: Added "all" field as an alias for showing everything.
authorTimo Sirainen <tss@iki.fi>
Wed, 16 Jun 2010 16:02:09 +0000 (17:02 +0100)
committerTimo Sirainen <tss@iki.fi>
Wed, 16 Jun 2010 16:02:09 +0000 (17:02 +0100)
--HG--
branch : HEAD

src/doveadm/doveadm-mail-mailbox-status.c

index d1039a719975655acbca1f95415c034f57536aff..cbdd022c935f21e4d50546d477337d2b4b8aa54c 100644 (file)
@@ -8,6 +8,11 @@
 #include "doveadm-mail.h"
 #include "doveadm-mail-list-iter.h"
 
+#define ALL_STATUS_ITEMS \
+       (STATUS_MESSAGES | STATUS_RECENT | \
+        STATUS_UIDNEXT | STATUS_UIDVALIDITY | \
+        STATUS_UNSEEN | STATUS_HIGHESTMODSEQ | STATUS_VIRTUAL_SIZE)
+
 #define TOTAL_STATUS_ITEMS \
        (STATUS_MESSAGES | STATUS_RECENT | STATUS_UNSEEN | STATUS_VIRTUAL_SIZE)
 
@@ -30,7 +35,14 @@ static void status_parse_fields(struct status_cmd_context *ctx,
        for (; *fields != NULL; fields++) {
                const char *field = *fields;
 
-               if (strcmp(field, "messages") == 0)
+               if (strcmp(field, "all") == 0) {
+                       if (ctx->total_sum)
+                               ctx->items |= TOTAL_STATUS_ITEMS;
+                       else {
+                               ctx->items |= ALL_STATUS_ITEMS;
+                               ctx->guid = TRUE;
+                       }
+               } else if (strcmp(field, "messages") == 0)
                        ctx->items |= STATUS_MESSAGES;
                else if (strcmp(field, "recent") == 0)
                        ctx->items |= STATUS_RECENT;