]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
quota: count - Always count with virtual size
authorAki Tuomi <aki.tuomi@open-xchange.com>
Fri, 25 Mar 2022 08:09:57 +0000 (10:09 +0200)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Tue, 29 Mar 2022 07:46:48 +0000 (10:46 +0300)
This code was needed because it was used by dict quota,
which is now removed.

src/plugins/quota/quota-count.c

index 93a6f1eaa8e257213dd8718847b339516c3e219c..b86f77ca9510244a342b6224b252d7d8eefb86cb 100644 (file)
@@ -47,9 +47,7 @@ quota_count_mailbox(struct quota_root *root, struct mail_namespace *ns,
        if ((box->storage->class_flags & MAIL_STORAGE_CLASS_FLAG_NOQUOTA) != 0) {
                /* quota doesn't exist for this mailbox/storage */
                ret = 0;
-       } else if (mailbox_get_metadata(box, root->quota->set->vsizes ?
-                                       MAILBOX_METADATA_VIRTUAL_SIZE :
-                                       MAILBOX_METADATA_PHYSICAL_SIZE,
+       } else if (mailbox_get_metadata(box, MAILBOX_METADATA_VIRTUAL_SIZE,
                                        &metadata) < 0 ||
            mailbox_get_status(box, STATUS_MESSAGES, &status) < 0) {
                errstr = mailbox_get_last_internal_error(box, &error);
@@ -72,8 +70,7 @@ quota_count_mailbox(struct quota_root *root, struct mail_namespace *ns,
                }
        } else {
                ret = 0;
-               *bytes += root->quota->set->vsizes ?
-                       metadata.virtual_size : metadata.physical_size;
+               *bytes += metadata.virtual_size;
                *count += status.messages;
        }
        mailbox_free(&box);