mu-maildir: refactor some duplicate code

mu-flags & mu-maildir were having some duplicate code; refactor it into mu-message-file.{cc,hh}
This commit is contained in:
Dirk-Jan C. Binnema
2022-06-03 21:59:27 +03:00
parent 9c59e894db
commit 172ff25bb6
9 changed files with 311 additions and 256 deletions

View File

@ -317,19 +317,6 @@ flags_from_expr(std::string_view expr,
return flags_from_absolute_expr(expr, true);
}
/**
* Get the Maildir flags from the full path of a mailfile. The flags are as
* specified in http://cr.yp.to/proto/maildir.html, plus MU_MSG_FLAG_NEW for new
* messages, ie the ones that live in new/. The flags are logically OR'ed. Note
* that the file does not have to exist; the flags are based on the path only.
*
* @param pathname of a mailfile; it does not have to refer to an existing
* file/message
*
* @return the message flags or Nothing
*/
Option<Flags> flags_from_path(const std::string& path);
/**
* Filter out flags which are not in the given category
*