mu-server: get rid of the sent-handler

We no longer need it; we can handle mu4e's sending directly in
mu4e-compose.
This commit is contained in:
Dirk-Jan C. Binnema
2024-04-09 23:47:35 +03:00
parent eda8db0c3b
commit 5e8c7493d9

View File

@ -184,7 +184,6 @@ struct Server::Private {
void queries_handler(const Command& cmd); void queries_handler(const Command& cmd);
void quit_handler(const Command& cmd); void quit_handler(const Command& cmd);
void remove_handler(const Command& cmd); void remove_handler(const Command& cmd);
void sent_handler(const Command& cmd);
void view_handler(const Command& cmd); void view_handler(const Command& cmd);
private: private:
@ -414,12 +413,6 @@ Server::Private::make_command_map()
"remove a message from filesystem and database", "remove a message from filesystem and database",
[&](const auto& params) { remove_handler(params); }}); [&](const auto& params) { remove_handler(params); }});
cmap.emplace(
"sent",
CommandInfo{ArgMap{{":path", ArgInfo{Type::String, true, "path to the message file"}}},
"tell mu about a message that was sent",
[&](const auto& params) { sent_handler(params); }});
cmap.emplace( cmap.emplace(
"view", "view",
CommandInfo{ArgMap{ CommandInfo{ArgMap{
@ -983,21 +976,6 @@ Server::Private::remove_handler(const Command& cmd)
output_sexp(Sexp().put_props(":remove", docid)); // act as if it worked. output_sexp(Sexp().put_props(":remove", docid)); // act as if it worked.
} }
void
Server::Private::sent_handler(const Command& cmd)
{
const auto path{cmd.string_arg(":path").value_or("")};
const auto docid = store().add_message(path);
if (!docid)
throw Error{Error::Code::Store, "failed to add path: {}: {}",
path, docid.error().what()};
output_sexp(Sexp().put_props(
":sent", Sexp::t_sym,
":path", path,
":docid", docid.value()));
}
void void
Server::Private::view_mark_as_read(Store::Id docid, Message&& msg, bool rename) Server::Private::view_mark_as_read(Store::Id docid, Message&& msg, bool rename)
{ {