]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap: Added STATUS (X-VSIZE) command for getting mailbox's virtual size.
authorTimo Sirainen <tss@iki.fi>
Wed, 12 May 2010 11:16:16 +0000 (13:16 +0200)
committerTimo Sirainen <tss@iki.fi>
Wed, 12 May 2010 11:16:16 +0000 (13:16 +0200)
--HG--
branch : HEAD

src/imap/imap-status.c

index be950778afac96998fbaca3d246b0f08f2f18ffd..58a66b8005583965449db2597fff0f3070578d95 100644 (file)
@@ -36,6 +36,8 @@ int imap_status_parse_items(struct client_command_context *cmd,
                        items |= STATUS_UNSEEN;
                else if (strcmp(item, "HIGHESTMODSEQ") == 0)
                        items |= STATUS_HIGHESTMODSEQ;
+               else if (strcmp(item, "X-VSIZE") == 0)
+                       items |= STATUS_VIRTUAL_SIZE;
                else if (strcmp(item, "X-GUID") == 0)
                        items_r->guid = TRUE;
                else {
@@ -120,6 +122,10 @@ void imap_status_send(struct client *client, const char *mailbox,
                str_printfa(str, "HIGHESTMODSEQ %llu ",
                            (unsigned long long)status->highest_modseq);
        }
+       if ((items->mailbox_items & STATUS_VIRTUAL_SIZE) != 0) {
+               str_printfa(str, "X-VSIZE %llu ",
+                           (unsigned long long)status->virtual_size);
+       }
        if (items->guid) {
                str_printfa(str, "X-GUID %s ",
                            mail_guid_128_to_string(result->mailbox_guid));