mirror of https://github.com/djcb/mu.git
flags: add flags_mail_dir_file util
And some whitespace cleanup
This commit is contained in:
parent
472f69beb2
commit
ae87be6a48
|
@ -348,7 +348,7 @@ flags_from_expr(std::string_view expr,
|
|||
* @param flags flags
|
||||
* @param cat category
|
||||
*
|
||||
* @return filter flags
|
||||
* @return filtered flags
|
||||
*/
|
||||
constexpr Flags
|
||||
flags_filter(Flags flags, MessageFlagCategory cat)
|
||||
|
@ -359,6 +359,25 @@ flags_filter(Flags flags, MessageFlagCategory cat)
|
|||
return flags;
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter out any flags which are _not_ Maildir / Mailfile flags
|
||||
*
|
||||
* @param flags flags
|
||||
*
|
||||
* @return filtered flags
|
||||
*/
|
||||
constexpr Flags
|
||||
flags_mail_dir_file(Flags flags)
|
||||
{
|
||||
for (auto&& info : AllMessageFlagInfos)
|
||||
if (info.category != MessageFlagCategory::Maildir &&
|
||||
info.category != MessageFlagCategory::Mailfile)
|
||||
flags &= ~info.flag;
|
||||
return flags;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Return flags, where flags = new_flags but with unmutable_flag in the
|
||||
|
|
Loading…
Reference in New Issue