mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-21 18:38:08 +01:00
lib: add notmuch_message_has_maildir_flag
I considered a higher level interface where the caller passes a tag name rather than a flag character, but the role of the "unread" tag is particularly confusing with such an interface.
This commit is contained in:
parent
8a8fb39b0c
commit
0a40ea4b48
2 changed files with 15 additions and 0 deletions
|
@ -1560,6 +1560,13 @@ _ensure_maildir_flags (notmuch_message_t *message, notmuch_bool_t force)
|
||||||
message->maildir_flags = combined_flags;
|
message->maildir_flags = combined_flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
notmuch_bool_t
|
||||||
|
notmuch_message_has_maildir_flag (notmuch_message_t *message, char flag)
|
||||||
|
{
|
||||||
|
_ensure_maildir_flags (message, FALSE);
|
||||||
|
return message->maildir_flags && (strchr (message->maildir_flags, flag) != NULL);
|
||||||
|
}
|
||||||
|
|
||||||
notmuch_status_t
|
notmuch_status_t
|
||||||
notmuch_message_maildir_flags_to_tags (notmuch_message_t *message)
|
notmuch_message_maildir_flags_to_tags (notmuch_message_t *message)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1612,6 +1612,14 @@ notmuch_message_remove_all_tags (notmuch_message_t *message);
|
||||||
notmuch_status_t
|
notmuch_status_t
|
||||||
notmuch_message_maildir_flags_to_tags (notmuch_message_t *message);
|
notmuch_message_maildir_flags_to_tags (notmuch_message_t *message);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* return TRUE if any filename of 'message' has maildir flag 'flag',
|
||||||
|
* FALSE otherwise.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
notmuch_bool_t
|
||||||
|
notmuch_message_has_maildir_flag (notmuch_message_t *message, char flag);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Rename message filename(s) to encode tags as maildir flags.
|
* Rename message filename(s) to encode tags as maildir flags.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue