0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 18:22:50 +01:00

modules/console: cmd to iterate through room state type-strings only.

This commit is contained in:
Jason Volk 2018-08-21 08:39:34 -07:00
parent 3a4817354e
commit 351a726ac5

View file

@ -4689,6 +4689,39 @@ console_cmd__room__state(opt &out, const string_view &line)
return true; return true;
} }
bool
console_cmd__room__state__types(opt &out, const string_view &line)
{
const auto &room_id
{
m::room_id(token(line, ' ', 0))
};
const auto &event_id
{
token(line, ' ', 1, {})
};
const m::room room
{
room_id, event_id
};
const m::room::state state
{
room
};
state.for_each(m::room::state::types{[&out]
(const string_view &type)
{
out << type << std::endl;
return true;
}});
return true;
}
bool bool
console_cmd__room__state__force(opt &out, const string_view &line) console_cmd__room__state__force(opt &out, const string_view &line)
{ {