better handle maildir cache

- get an updated maildir list after indexing
- add mu4e-added items to the list opportunistically

Remove mu4e-clear-caches / mu4e-cache-maildir-list to mu4e-obsolete.el

Fixes #2537.
This commit is contained in:
Dirk-Jan C. Binnema
2023-08-19 19:41:56 +03:00
parent 15f08488d3
commit f73aad2b41
6 changed files with 40 additions and 35 deletions

View File

@ -886,15 +886,20 @@ Server::Private::mkdir_handler(const Command& cmd)
const auto path{cmd.string_arg(":path").value_or("<error>")};
const auto update{cmd.boolean_arg(":update")};
if (path.find(store().root_maildir()) != 0)
throw Error{Error::Code::File, "maildir is not below root-maildir"};
if (auto&& res = maildir_mkdir(path, 0755, false); !res)
throw res.error();
/* mu4e does a lot of opportunistic 'mkdir', only send it updates when
* requested */
if (update)
output_sexp(Sexp().put_props(":info", "mkdir",
":message",
mu_format("{} has been created", path)));
if (!update)
return;
output_sexp(Sexp().put_props(":info", "mkdir",
":message",
mu_format("{} has been created", path)));
}
void