X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=flags.c;h=fd3333fa24a8c5bbd6050147afe82fa8e09a4090;hp=c3f14bd7473931e62a01bf7d6b7274851aac7f02;hb=5e53f9e5f65aa5b3af6f5af9d868403536534afb;hpb=c3e57678c8be193fc137854020f3a90887be97c9 diff --git a/flags.c b/flags.c index c3f14bd..fd3333f 100644 --- a/flags.c +++ b/flags.c @@ -22,11 +22,14 @@ #include "imap_private.h" #endif +#include "lib/intl.h" + void _mutt_set_flag (CONTEXT * ctx, HEADER * h, int flag, int bf, int upd_ctx) { int changed = h->changed; int deleted = ctx->deleted; int tagged = ctx->tagged; + int flagged = ctx->flagged; if (ctx->readonly && flag != M_TAG) return; /* don't modify anything if we are read-only */ @@ -34,13 +37,8 @@ void _mutt_set_flag (CONTEXT * ctx, HEADER * h, int flag, int bf, int upd_ctx) 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) { @@ -108,13 +106,8 @@ void _mutt_set_flag (CONTEXT * ctx, HEADER * h, int flag, int bf, int upd_ctx) 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) { @@ -146,13 +139,8 @@ void _mutt_set_flag (CONTEXT * ctx, HEADER * h, int flag, int bf, int upd_ctx) 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) { @@ -178,13 +166,8 @@ void _mutt_set_flag (CONTEXT * ctx, HEADER * h, int flag, int bf, int upd_ctx) 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) { @@ -214,13 +197,8 @@ void _mutt_set_flag (CONTEXT * ctx, HEADER * h, int flag, int bf, int upd_ctx) 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) { @@ -248,13 +226,8 @@ void _mutt_set_flag (CONTEXT * ctx, HEADER * h, int flag, int bf, int upd_ctx) 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) { @@ -298,11 +271,10 @@ void _mutt_set_flag (CONTEXT * ctx, HEADER * h, int flag, int bf, int upd_ctx) * search results so that any future search will match the current status * of this message and not what it was at the time it was last searched. */ - if (h->searched - && (changed != h->changed || deleted != ctx->deleted - || tagged != ctx->tagged)) + if (h->searched && (changed != h->changed || deleted != ctx->deleted || + tagged != ctx->tagged || flagged != ctx->flagged)) h->searched = 0; - draw_sidebar (0); + sidebar_draw (0); } void mutt_tag_set_flag (int flag, int bf)