Mercurial > dovecot > core-2.2
changeset 11555:33f9b211f213 HEAD
doveadm mailbox status: Added "all" field as an alias for showing everything.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Wed, 16 Jun 2010 17:02:09 +0100 |
parents | dec8986d33ea |
children | dd1f0a7127a9 |
files | src/doveadm/doveadm-mail-mailbox-status.c |
diffstat | 1 files changed, 13 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/doveadm/doveadm-mail-mailbox-status.c Wed Jun 16 16:49:56 2010 +0100 +++ b/src/doveadm/doveadm-mail-mailbox-status.c Wed Jun 16 17:02:09 2010 +0100 @@ -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 @@ 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;