Mercurial > dovecot > original-hg > dovecot-1.2
changeset 7172:097fe25ab218 HEAD
If quota limits weren't specified, they should have been taken from
maildirsize file.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Sun, 20 Jan 2008 08:49:36 +0200 |
parents | 2e60288f0d75 |
children | 9841a8563116 |
files | src/plugins/quota/quota-maildir.c |
diffstat | 1 files changed, 10 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/plugins/quota/quota-maildir.c Sat Jan 19 09:14:50 2008 +0200 +++ b/src/plugins/quota/quota-maildir.c Sun Jan 20 08:49:36 2008 +0200 @@ -677,18 +677,24 @@ static int maildir_quota_get_resource(struct quota_root *_root, const char *name, - uint64_t *value_r, uint64_t *limit ATTR_UNUSED) + uint64_t *value_r, uint64_t *limit_r) { struct maildir_quota_root *root = (struct maildir_quota_root *)_root; if (maildirquota_refresh(root) < 0) return -1; - if (strcmp(name, QUOTA_NAME_STORAGE_BYTES) == 0) + if (strcmp(name, QUOTA_NAME_STORAGE_BYTES) == 0) { *value_r = root->total_bytes; - else if (strcmp(name, QUOTA_NAME_MESSAGES) == 0) + if (!root->master_message_limits && + root->message_bytes_limit != (uint64_t)-1) + *limit_r = root->message_bytes_limit; + } else if (strcmp(name, QUOTA_NAME_MESSAGES) == 0) { *value_r = root->total_count; - else + if (!root->master_message_limits && + root->message_count_limit != (uint64_t)-1) + *limit_r = root->message_count_limit; + } else return 0; return 1; }