struct acl_mailbox {
union mailbox_module_context module_ctx;
struct acl_object *aclobj;
-
- unsigned int save_hack:1;
};
struct acl_transaction_context {
struct notify_transaction_context {
union mailbox_transaction_module_context module_ctx;
struct mail *tmp_mail;
- bool save_hack;
};
static MODULE_CONTEXT_DEFINE_INIT(notify_storage_module,
ctx->dest_mail = lt->tmp_mail;
}
- lt->save_hack = TRUE;
- ret = lbox->super.copy(ctx, mail);
- lt->save_hack = FALSE;
-
- if (ret == 0)
+ if ((ret = lbox->super.copy(ctx, mail)) == 0)
notify_contexts_mail_copy(mail, ctx->dest_mail);
return ret;
}
NOTIFY_CONTEXT(ctx->transaction);
union mailbox_module_context *lbox =
NOTIFY_CONTEXT(ctx->transaction->box);
+ struct mail *dest_mail = ctx->copying ? NULL : ctx->dest_mail;
if (lbox->super.save_finish(ctx) < 0)
return -1;
- if (!lt->save_hack)
- notify_contexts_mail_save(ctx->dest_mail);
+ if (dest_mail != NULL)
+ notify_contexts_mail_save(dest_mail);
return 0;
}
ARRAY_DEFINE(expunge_uids, uint32_t);
ARRAY_DEFINE(expunge_sizes, uoff_t);
- unsigned int save_hack:1;
unsigned int recalculate:1;
};
ctx->dest_mail = qt->tmp_mail;
}
- qbox->save_hack = FALSE;
if (qbox->module_ctx.super.copy(ctx, mail) < 0)
return -1;
- /* if copying used saving internally, we already checked the quota
- and set qbox->save_hack = TRUE. */
- return qbox->save_hack ? 0 : quota_check(t, ctx->dest_mail);
+ /* if copying used saving internally, we already checked the quota */
+ return ctx->copying ? 0 : quota_check(t, ctx->dest_mail);
}
static int
if (qbox->module_ctx.super.save_finish(ctx) < 0)
return -1;
- qbox->save_hack = TRUE;
return quota_check(ctx->transaction, ctx->dest_mail);
}