/**
* set_flag - append str to flags if we currently have permission according to aclflag
* @param[in] m Selected Imap Mailbox
- * @param[in] aclflag Permissions, e.g. #MUTT_ACL_WRITE
+ * @param[in] aclflag Permissions, see #AclFlags
* @param[in] flag Does the email have the flag set?
* @param[in] str Server flag name
* @param[out] flags Buffer for server command
* @param[in] flsize Length of buffer
*/
-static void set_flag(struct Mailbox *m, int aclflag, int flag, const char *str,
- char *flags, size_t flsize)
+static void set_flag(struct Mailbox *m, AclFlags aclflag, int flag,
+ const char *str, char *flags, size_t flsize)
{
if (m->rights & aclflag)
if (flag && imap_has_flag(&imap_mdata_get(m)->flags, str))
/**
* sync_helper - Sync flag changes to the server
* @param m Selected Imap Mailbox
- * @param right ACL, e.g. #MUTT_ACL_DELETE
+ * @param right ACL, see #AclFlags
* @param flag Mutt flag, e.g. MUTT_DELETED
* @param name Name of server flag
* @retval >=0 Success, number of messages
* @retval -1 Failure
*/
-static int sync_helper(struct Mailbox *m, int right, int flag, const char *name)
+static int sync_helper(struct Mailbox *m, AclFlags right, int flag, const char *name)
{
int count = 0;
int rc;
/**
* check_acl - Check the ACLs for a function
* @param ctx Mailbox
- * @param acl ACL, e.g. #MUTT_ACL_DELETE
+ * @param acl ACL, see #AclFlags
* @param msg Error message for failure
* @retval bool true if the function is permitted
*/
-static bool check_acl(struct Context *ctx, int acl, const char *msg)
+static bool check_acl(struct Context *ctx, AclFlags acl, const char *msg)
{
if (!ctx || !ctx->mailbox)
return false;
{
if (!prereq(Context, menu, CHECK_IN_MAILBOX | CHECK_MSGCOUNT | CHECK_VISIBLE | CHECK_READONLY))
break;
- /* CHECK_ACL(MUTT_ACL_WRITE); */
+ /* check_acl(MUTT_ACL_WRITE); */
struct EmailList el = STAILQ_HEAD_INITIALIZER(el);
el_add_tagged(&el, Context, CUR_EMAIL, tag);
/**
* ACL Rights - These show permission to...
*/
-#define MUTT_ACL_ADMIN (1 << 0) ///< administer the account (get/set permissions)
-#define MUTT_ACL_CREATE (1 << 1) ///< create a mailbox
-#define MUTT_ACL_DELETE (1 << 2) ///< delete a message
-#define MUTT_ACL_DELMX (1 << 3) ///< delete a mailbox
-#define MUTT_ACL_EXPUNGE (1 << 4) ///< expunge messages
-#define MUTT_ACL_INSERT (1 << 5) ///< add/copy into the mailbox (used when editing a message)
-#define MUTT_ACL_LOOKUP (1 << 6) ///< lookup mailbox (visible to 'list')
-#define MUTT_ACL_POST (1 << 7) ///< post (submit messages to the server)
-#define MUTT_ACL_READ (1 << 8) ///< read the mailbox
-#define MUTT_ACL_SEEN (1 << 9) ///< change the 'seen' status of a message
-#define MUTT_ACL_WRITE (1 << 10) ///< write to a message (for flagging or linking threads)
+typedef uint16_t AclFlags; ///< Flags, e.g. #MUTT_ACL_ADMIN
+#define MUTT_ACL_NO_FLAGS 0 ///< No flags are set
+#define MUTT_ACL_ADMIN (1 << 0) ///< Administer the account (get/set permissions)
+#define MUTT_ACL_CREATE (1 << 1) ///< Create a mailbox
+#define MUTT_ACL_DELETE (1 << 2) ///< Delete a message
+#define MUTT_ACL_DELMX (1 << 3) ///< Delete a mailbox
+#define MUTT_ACL_EXPUNGE (1 << 4) ///< Expunge messages
+#define MUTT_ACL_INSERT (1 << 5) ///< Add/copy into the mailbox (used when editing a message)
+#define MUTT_ACL_LOOKUP (1 << 6) ///< Lookup mailbox (visible to 'list')
+#define MUTT_ACL_POST (1 << 7) ///< Post (submit messages to the server)
+#define MUTT_ACL_READ (1 << 8) ///< Read the mailbox
+#define MUTT_ACL_SEEN (1 << 9) ///< Change the 'seen' status of a message
+#define MUTT_ACL_WRITE (1 << 10) ///< Write to a message (for flagging or linking threads)
#define MUTT_ACL_ALL ((1 << 11) - 1)
bool quiet : 1; /**< inhibit status messages? */
bool readonly : 1; /**< don't allow changes to the mailbox */
- unsigned int rights; /**< ACL bits */
+ AclFlags rights; /**< ACL bits, see #AclFlags */
#ifdef USE_COMPRESSED
void *compress_info; /**< compressed mbox module private data */