lib: use flags_maildir_file
It's a better name. And fix some typos.
This commit is contained in:
@ -138,7 +138,6 @@ test_flags_from_delta_expr()
|
|||||||
"-S", Flags::Seen).value() ==
|
"-S", Flags::Seen).value() ==
|
||||||
Flags::Unread);
|
Flags::Unread);
|
||||||
|
|
||||||
|
|
||||||
static_assert(flags_from_delta_expr("+R+P-F", Flags::Seen).value() ==
|
static_assert(flags_from_delta_expr("+R+P-F", Flags::Seen).value() ==
|
||||||
(Flags::Seen|Flags::Passed|Flags::Replied));
|
(Flags::Seen|Flags::Passed|Flags::Replied));
|
||||||
/* '-B' is invalid */
|
/* '-B' is invalid */
|
||||||
|
|||||||
@ -144,7 +144,6 @@ constexpr std::array<MessageFlagInfo, 14> AllMessageFlagInfos = {{
|
|||||||
MessageFlagInfo{Flags::HasAttachment,'a', "attach", MessageFlagCategory::Content,
|
MessageFlagInfo{Flags::HasAttachment,'a', "attach", MessageFlagCategory::Content,
|
||||||
"Has at least one attachment"
|
"Has at least one attachment"
|
||||||
},
|
},
|
||||||
|
|
||||||
MessageFlagInfo{Flags::Unread, 'u', "unread", MessageFlagCategory::Pseudo,
|
MessageFlagInfo{Flags::Unread, 'u', "unread", MessageFlagCategory::Pseudo,
|
||||||
"New or not seen message"
|
"New or not seen message"
|
||||||
},
|
},
|
||||||
@ -289,9 +288,9 @@ flags_from_absolute_expr(std::string_view expr, bool ignore_invalid = false)
|
|||||||
* @param expr delta expression
|
* @param expr delta expression
|
||||||
* @param flags existing flags
|
* @param flags existing flags
|
||||||
* @param ignore_invalid if @true, ignore invalid flags, otherwise return
|
* @param ignore_invalid if @true, ignore invalid flags, otherwise return
|
||||||
* nullopt if an invalid flag is encountered
|
* Nothing if an invalid flag is encountered
|
||||||
*
|
*
|
||||||
* @return new flags, or nullopt in case of error
|
* @return new flags, or Nothing in case of error
|
||||||
*/
|
*/
|
||||||
constexpr Option<Flags>
|
constexpr Option<Flags>
|
||||||
flags_from_delta_expr(std::string_view expr, Flags flags,
|
flags_from_delta_expr(std::string_view expr, Flags flags,
|
||||||
@ -317,7 +316,6 @@ flags_from_delta_expr(std::string_view expr, Flags flags,
|
|||||||
}
|
}
|
||||||
|
|
||||||
return imply_unread(flags);
|
return imply_unread(flags);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -366,7 +364,7 @@ flags_filter(Flags flags, MessageFlagCategory cat)
|
|||||||
* @return filtered flags
|
* @return filtered flags
|
||||||
*/
|
*/
|
||||||
constexpr Flags
|
constexpr Flags
|
||||||
flags_mail_dir_file(Flags flags)
|
flags_maildir_file(Flags flags)
|
||||||
{
|
{
|
||||||
for (auto&& info : AllMessageFlagInfos)
|
for (auto&& info : AllMessageFlagInfos)
|
||||||
if (info.category != MessageFlagCategory::Maildir &&
|
if (info.category != MessageFlagCategory::Maildir &&
|
||||||
|
|||||||
@ -421,7 +421,7 @@ Mu::maildir_determine_target(const std::string& old_path,
|
|||||||
Flags newflags,
|
Flags newflags,
|
||||||
bool new_name)
|
bool new_name)
|
||||||
{
|
{
|
||||||
newflags = flags_mail_dir_file(newflags); // filter out irrelevant flags.
|
newflags = flags_maildir_file(newflags); // filter out irrelevant flags.
|
||||||
|
|
||||||
/* sanity checks */
|
/* sanity checks */
|
||||||
if (const auto checked{check_determine_target_params(
|
if (const auto checked{check_determine_target_params(
|
||||||
|
|||||||
@ -94,7 +94,7 @@ Result<void> maildir_move_message(const std::string& oldpath,
|
|||||||
*
|
*
|
||||||
* @param old_path an absolute file system path to an existing message in an
|
* @param old_path an absolute file system path to an existing message in an
|
||||||
* actual maildir
|
* actual maildir
|
||||||
* @param root_maildir_path the absolete file system path under which
|
* @param root_maildir_path the absolute file system path under which
|
||||||
* all maildirs live.
|
* all maildirs live.
|
||||||
* @param target_maildir the target maildir; note that this the base-level
|
* @param target_maildir the target maildir; note that this the base-level
|
||||||
* Maildir, ie. /home/user/Maildir/archive, and must _not_ include the
|
* Maildir, ie. /home/user/Maildir/archive, and must _not_ include the
|
||||||
@ -102,8 +102,8 @@ Result<void> maildir_move_message(const std::string& oldpath,
|
|||||||
* same filesystem. Can be empty if the message should not be moved to
|
* same filesystem. Can be empty if the message should not be moved to
|
||||||
* a different maildir; note that this may still involve a
|
* a different maildir; note that this may still involve a
|
||||||
* move to another directory (say, from new/ to cur/)
|
* move to another directory (say, from new/ to cur/)
|
||||||
* @param flags to set for the target (influences the filename, path). Any none-Maildir/File
|
* @param flags to set for the target (influences the filename, path).
|
||||||
* flags are ignored.
|
* Any non-Maildir/File flags are ignored.
|
||||||
* @param new_name whether to change the basename of the file
|
* @param new_name whether to change the basename of the file
|
||||||
*
|
*
|
||||||
* @return Full path name of the target file or an Error
|
* @return Full path name of the target file or an Error
|
||||||
|
|||||||
Reference in New Issue
Block a user