mirror of
https://github.com/matrix-construct/construct
synced 2024-11-16 15:00:51 +01:00
modules/console: Add room members count cmd.
This commit is contained in:
parent
918815a874
commit
7f1dc09d52
1 changed files with 32 additions and 0 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue