/* If user is under quota before saving a mail, allow the last mail to
bring the user over quota by this many bytes. */
uint64_t quota_storage_grace;
-
- /* TRUE if any of the warning_rules have reverse==TRUE */
- bool have_reverse_warnings:1;
};
struct quota_root {
warning->command = p_strdup(pool, p+1);
warning->rule = rule;
warning->reverse = reverse;
- if (reverse)
- root_set->have_reverse_warnings = TRUE;
quota_root_recalculate_relative_rules(event, root_set,
root_set->default_rule.bytes_limit,
return *limit_r == 0 ? QUOTA_GET_RESULT_UNLIMITED : QUOTA_GET_RESULT_LIMITED;
}
+static bool quota_root_have_reverse_warnings(struct quota_root *root)
+{
+ const struct quota_warning_rule *warn;
+ array_foreach(&root->set->warning_rules, warn) {
+ if (warn->reverse)
+ return TRUE;
+ }
+ return FALSE;
+}
+
struct quota_transaction_context *quota_transaction_begin(struct mailbox *box)
{
struct quota_transaction_context *ctx;
before and after the expunges, but that's more complicated
and probably isn't any better.) */
if (!(*rootp)->auto_updating ||
- (*rootp)->set->have_reverse_warnings)
+ quota_root_have_reverse_warnings(*rootp))
ctx->auto_updating = FALSE;
}