dovecot-2.0: doveadm mailbox status: Added "all" field as an ali...

dovecot at dovecot.org dovecot at dovecot.org
Wed Jun 16 19:02:15 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/33f9b211f213
changeset: 11555:33f9b211f213
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Jun 16 17:02:09 2010 +0100
description:
doveadm mailbox status: Added "all" field as an alias for showing everything.

diffstat:

 src/doveadm/doveadm-mail-mailbox-status.c |  14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diffs (31 lines):

diff -r dec8986d33ea -r 33f9b211f213 src/doveadm/doveadm-mail-mailbox-status.c
--- 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;


More information about the dovecot-cvs mailing list