mirror of https://github.com/djcb/mu.git
message-file: filter out non-file flags
Only take flags from file names that are actually file-flags, not random other things
This commit is contained in:
parent
9bf580de3d
commit
1ec03ce07c
|
@ -111,8 +111,10 @@ Mu::flags_from_path(const std::string& path)
|
|||
return Err(Error{Error::Code::InvalidArgument,
|
||||
"invalid flags ('%s')", parts.flags_suffix.c_str()});
|
||||
/* LCOV_EXCL_STOP*/
|
||||
} else
|
||||
return Ok(std::move(flags.value()));
|
||||
}
|
||||
|
||||
/* of course, only _file_ flags are allowed */
|
||||
return Ok(flags_filter(flags.value(), MessageFlagCategory::Mailfile));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -169,7 +169,7 @@ test_mu_msg_flags(void)
|
|||
(Flags::Flagged | Flags::Seen |
|
||||
Flags::HasAttachment)},
|
||||
{MU_TESTMAILDIR4 "/special!2,Sabc",
|
||||
(Flags::Seen|Flags::HasAttachment)}
|
||||
(Flags::Seen)}
|
||||
}};
|
||||
|
||||
for (auto&& test: tests) {
|
||||
|
|
Loading…
Reference in New Issue