summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDirk-Jan C. Binnema <djcb@djcbsoftware.nl>2021-05-02 23:10:35 +0300
committerDirk-Jan C. Binnema <djcb@djcbsoftware.nl>2021-05-02 23:30:32 +0300
commitbed6058fdc1bc9ac5845d0fc761bdabb6ac1b7b3 (patch)
tree31a5e49ae6f4bbf7d84327647f2bf2eab79b68b1 /lib
parentb8f8ffa967cf9078b9d369ed6408d2466e9644eb (diff)
mu-server: add thread-date as emacs timestamp
So we can more easily deal with it from elisp.
Diffstat (limited to 'lib')
-rw-r--r--lib/mu-server.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/mu-server.cc b/lib/mu-server.cc
index f92b124..fcf3d82 100644
--- a/lib/mu-server.cc
+++ b/lib/mu-server.cc
@@ -138,6 +138,13 @@ add_thread_info (Sexp::List& items, const QueryMatch& qmatch)
info.add_prop(":level", Sexp::make_number(qmatch.thread_level));
info.add_prop(":date", Sexp::make_string(qmatch.thread_date));
+ Sexp::List dlist;
+ const auto td {::atoi(qmatch.thread_date.c_str())};
+ dlist.add(Sexp::make_number((unsigned)(td >> 16)));
+ dlist.add(Sexp::make_number((unsigned)(td & 0xffff)));
+ dlist.add(Sexp::make_number(0));
+ info.add_prop(":date-tstamp", Sexp::make_list(std::move(dlist)));
+
if (qmatch.has_flag(QueryMatch::Flags::Root))
info.add_prop( ":root", symbol_t());
if (qmatch.has_flag(QueryMatch::Flags::Related))