diff --git a/include/ircd/m/event.h b/include/ircd/m/event.h index b416f87c9..d060d840e 100644 --- a/include/ircd/m/event.h +++ b/include/ircd/m/event.h @@ -27,7 +27,7 @@ namespace ircd::m void check_size(const event &); std::string pretty(const event &); - std::string pretty_oneline(const event &); + std::string pretty_oneline(const event &, const bool &content_keys = true); id::event event_id(const event &, id::event::buf &buf, const const_buffer &hash); id::event event_id(const event &, id::event::buf &buf); diff --git a/ircd/m/event.cc b/ircd/m/event.cc index 70802bc9a..f631cc723 100644 --- a/ircd/m/event.cc +++ b/ircd/m/event.cc @@ -287,7 +287,8 @@ ircd::m::pretty(const event &event) } std::string -ircd::m::pretty_oneline(const event &event) +ircd::m::pretty_oneline(const event &event, + const bool &content_keys) { std::string ret; std::stringstream s; @@ -357,7 +358,13 @@ ircd::m::pretty_oneline(const event &event) out("membership", json::get<"membership"_>(event)); out("redacts", json::get<"redacts"_>(event)); - const json::object &contents{json::get<"content"_>(event)}; + const json::object &contents + { + content_keys? + json::get<"content"_>(event): + json::object{} + }; + if(!contents.empty()) { s << "+" << string_view{contents}.size() << " bytes :";