0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-29 08:54:02 +01:00

modules/console: Split room members cmd for full event and just user_id.

This commit is contained in:
Jason Volk 2018-05-20 20:18:19 -07:00
parent db026147b7
commit 78513d7998

View file

@ -3102,6 +3102,44 @@ console_cmd__room__members(opt &out, const string_view &line)
room room
}; };
const m::room::members::closure closure{[&out]
(const m::user::id &user_id)
{
out << user_id << std::endl;
}};
members.for_each(membership, closure);
return true;
}
bool
console_cmd__room__members__events(opt &out, const string_view &line)
{
const params param{line, " ",
{
"room_id", "[membership]"
}};
const auto &room_id
{
m::room_id(param.at(0))
};
const string_view membership
{
param[1]
};
const m::room room
{
room_id
};
const m::room::members members
{
room
};
const auto closure{[&out](const m::event &event) const auto closure{[&out](const m::event &event)
{ {
out << pretty_oneline(event) << std::endl; out << pretty_oneline(event) << std::endl;