switch (flag) {
case M_DELETE:
-#ifdef USE_IMAP
- if (ctx && ctx->magic == M_IMAP)
- if (mutt_bit_isset (((IMAP_DATA *) ctx->data)->capabilities, ACL)
- && !mutt_bit_isset (((IMAP_DATA *) ctx->data)->rights,
- IMAP_ACL_DELETE))
- return;
-#endif
+ if (!mx_acl_check (ctx, ACL_DELETE))
+ return;
if (bf) {
if (!h->deleted && !ctx->readonly) {
case M_NEW:
-#ifdef USE_IMAP
- if (ctx && ctx->magic == M_IMAP)
- if (mutt_bit_isset (((IMAP_DATA *) ctx->data)->capabilities, ACL)
- && !mutt_bit_isset (((IMAP_DATA *) ctx->data)->rights,
- IMAP_ACL_SEEN))
- return;
-#endif
+ if (!mx_acl_check (ctx, ACL_SEEN))
+ return;
if (bf) {
if (h->read || h->old) {
case M_OLD:
-#ifdef USE_IMAP
- if (ctx && ctx->magic == M_IMAP)
- if (mutt_bit_isset (((IMAP_DATA *) ctx->data)->capabilities, ACL)
- && !mutt_bit_isset (((IMAP_DATA *) ctx->data)->rights,
- IMAP_ACL_SEEN))
- return;
-#endif
+ if (!mx_acl_check (ctx, ACL_SEEN))
+ return;
if (bf) {
if (!h->old) {
case M_READ:
-#ifdef USE_IMAP
- if (ctx && ctx->magic == M_IMAP)
- if (mutt_bit_isset (((IMAP_DATA *) ctx->data)->capabilities, ACL)
- && !mutt_bit_isset (((IMAP_DATA *) ctx->data)->rights,
- IMAP_ACL_SEEN))
- return;
-#endif
+ if (!mx_acl_check (ctx, ACL_SEEN))
+ return;
if (bf) {
if (!h->read) {
case M_REPLIED:
-#ifdef USE_IMAP
- if (ctx && ctx->magic == M_IMAP)
- if (mutt_bit_isset (((IMAP_DATA *) ctx->data)->capabilities, ACL)
- && !mutt_bit_isset (((IMAP_DATA *) ctx->data)->rights,
- IMAP_ACL_WRITE))
- return;
-#endif
+ if (!mx_acl_check (ctx, ACL_WRITE))
+ return;
if (bf) {
if (!h->replied) {
case M_FLAG:
-#ifdef USE_IMAP
- if (ctx && ctx->magic == M_IMAP)
- if (mutt_bit_isset (((IMAP_DATA *) ctx->data)->capabilities, ACL)
- && !mutt_bit_isset (((IMAP_DATA *) ctx->data)->rights,
- IMAP_ACL_WRITE))
- return;
-#endif
+ if (!mx_acl_check (ctx, ACL_WRITE))
+ return;
if (bf) {
if (!h->flagged) {