mirror of https://github.com/djcb/mu.git
message-sexp: Add :modified and :reply-to
This commit is contained in:
parent
e1a0ea49f3
commit
e067bca090
|
@ -106,7 +106,9 @@ add_contacts(Sexp::List& list, const Message& message)
|
||||||
add_contact_type(message.cc(), ":cc");
|
add_contact_type(message.cc(), ":cc");
|
||||||
add_contact_type(message.bcc(), ":bcc");
|
add_contact_type(message.bcc(), ":bcc");
|
||||||
|
|
||||||
// FIXME: reply-to.
|
const auto reply_to = seq_filter(message.all_contacts(),[](auto &&c) {
|
||||||
|
return c.type == Contact::Type::ReplyTo; });
|
||||||
|
add_contact_type(reply_to, ":reply-to");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -125,14 +127,16 @@ add_flags(Sexp::List& list, const Message& message)
|
||||||
static void
|
static void
|
||||||
add_date_and_size(Sexp::List& items, const Message& message)
|
add_date_and_size(Sexp::List& items, const Message& message)
|
||||||
{
|
{
|
||||||
auto t{message.date()};
|
auto emacs_tstamp = [](::time_t t) {
|
||||||
if (t != 0) {
|
|
||||||
Sexp::List dlist;
|
Sexp::List dlist;
|
||||||
dlist.add(Sexp::make_number((unsigned)(t >> 16)));
|
dlist.add(Sexp::make_number(static_cast<unsigned>(t >> 16)));
|
||||||
dlist.add(Sexp::make_number((unsigned)(t & 0xffff)));
|
dlist.add(Sexp::make_number(static_cast<unsigned>(t & 0xffff)));
|
||||||
dlist.add(Sexp::make_number(0));
|
dlist.add(Sexp::make_number(0));
|
||||||
items.add_prop(":date", Sexp::make_list(std::move(dlist)));
|
return Sexp::make_list(std::move(dlist));
|
||||||
}
|
};
|
||||||
|
|
||||||
|
items.add_prop(":date", emacs_tstamp(message.date()));
|
||||||
|
items.add_prop(":modified", emacs_tstamp(message.modified()));
|
||||||
|
|
||||||
auto size{message.size()};
|
auto size{message.size()};
|
||||||
if (size != 0)
|
if (size != 0)
|
||||||
|
|
Loading…
Reference in New Issue