0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-09-28 19:58:53 +02:00

modules/console: Add room members count cmd.

This commit is contained in:
Jason Volk 2018-07-05 15:59:41 -07:00
parent 918815a874
commit 7f1dc09d52

View file

@ -4343,6 +4343,38 @@ console_cmd__room__members__events(opt &out, const string_view &line)
return true;
}
bool
console_cmd__room__members__count(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
};
out << members.count(membership) << std::endl;
return true;
}
bool
console_cmd__room__members__origin(opt &out, const string_view &line)
{