Mercurial > dovecot > core-2.2
comparison src/plugins/acl/acl-mailbox.c @ 8726:68db63cc32b3 HEAD
Mail copying API changed to be based on save API. This allows extending it easily in future.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Fri, 06 Feb 2009 12:49:46 -0500 |
parents | b9faf4db2a9f |
children | e374a365521d |
comparison
equal
deleted
inserted
replaced
8725:c7142c9ac3c1 | 8726:68db63cc32b3 |
---|---|
285 | 285 |
286 return abox->module_ctx.super.save_begin(ctx, input); | 286 return abox->module_ctx.super.save_begin(ctx, input); |
287 } | 287 } |
288 | 288 |
289 static int | 289 static int |
290 acl_copy(struct mailbox_transaction_context *t, struct mail *mail, | 290 acl_copy(struct mail_save_context *ctx, struct mail *mail) |
291 enum mail_flags flags, struct mail_keywords *keywords, | 291 { |
292 struct mail *dest_mail) | 292 struct mailbox_transaction_context *t = ctx->transaction; |
293 { | |
294 struct acl_mailbox *abox = ACL_CONTEXT(t->box); | 293 struct acl_mailbox *abox = ACL_CONTEXT(t->box); |
295 enum acl_storage_rights save_right; | 294 enum acl_storage_rights save_right; |
296 | 295 |
297 save_right = (t->box->open_flags & MAILBOX_OPEN_POST_SESSION) != 0 ? | 296 save_right = (t->box->open_flags & MAILBOX_OPEN_POST_SESSION) != 0 ? |
298 ACL_STORAGE_RIGHT_POST : ACL_STORAGE_RIGHT_INSERT; | 297 ACL_STORAGE_RIGHT_POST : ACL_STORAGE_RIGHT_INSERT; |
299 if (acl_mailbox_right_lookup(t->box, save_right) <= 0) | 298 if (acl_mailbox_right_lookup(t->box, save_right) <= 0) |
300 return -1; | 299 return -1; |
301 if (acl_save_get_flags(t->box, &flags, &keywords) < 0) | 300 if (acl_save_get_flags(t->box, &ctx->flags, &ctx->keywords) < 0) |
302 return -1; | 301 return -1; |
303 | 302 |
304 return abox->module_ctx.super.copy(t, mail, flags, keywords, dest_mail); | 303 return abox->module_ctx.super.copy(ctx, mail); |
305 } | 304 } |
306 | 305 |
307 static int | 306 static int |
308 acl_transaction_commit(struct mailbox_transaction_context *ctx, | 307 acl_transaction_commit(struct mailbox_transaction_context *ctx, |
309 uint32_t *uid_validity_r, | 308 uint32_t *uid_validity_r, |