From f1d5b0798e846e74f5949395ee592f239ba75416 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Thu, 10 Jan 2019 13:56:44 -0800 Subject: [PATCH] modules/m_event: Improve pretty_oneline() for edu's. --- modules/m_event.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/modules/m_event.cc b/modules/m_event.cc index 851447943..3fd0ac316 100644 --- a/modules/m_event.cc +++ b/modules/m_event.cc @@ -150,8 +150,16 @@ pretty_oneline__event(std::ostream &s, "sender", }; - s << json::get<"room_id"_>(event) << " "; - s << json::get<"depth"_>(event) << " :"; + if(defined(json::get<"room_id"_>(event))) + s << json::get<"room_id"_>(event) << " "; + else + s << "* "; + + if(json::get<"depth"_>(event) != json::undefined_number) + s << json::get<"depth"_>(event) << " :"; + else + s << "* :"; + json::for_each(event, top_keys, out); const auto &auth_events{json::get<"auth_events"_>(event)};