mirror of
https://github.com/matrix-construct/construct
synced 2025-02-18 09:40:12 +01:00
modules/console: Improve room__top cmd w/ more types.
This commit is contained in:
parent
351a726ac5
commit
c1e135967a
1 changed files with 17 additions and 4 deletions
|
@ -4105,13 +4105,26 @@ console_cmd__room__top(opt &out, const string_view &line)
|
|||
out << "event: " << std::get<m::event::id::buf>(top) << std::endl;
|
||||
out << "m_state: " << std::endl;
|
||||
|
||||
const unique_buffer<mutable_buffer> buf{64_KiB};
|
||||
const m::room::state::tuple state
|
||||
const m::room::state state
|
||||
{
|
||||
room_id, buf
|
||||
room_id
|
||||
};
|
||||
|
||||
out << pretty(state) << std::endl;
|
||||
state.for_each(m::room::state::types{[&out, &state]
|
||||
(const string_view &type)
|
||||
{
|
||||
if(!startswith(type, "m."))
|
||||
return true;
|
||||
|
||||
state.for_each(type, m::event::closure{[&out]
|
||||
(const m::event &event)
|
||||
{
|
||||
if(json::get<"state_key"_>(event) == "")
|
||||
out << pretty_oneline(event) << std::endl;
|
||||
}});
|
||||
|
||||
return true;
|
||||
}});
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue