mirror of
https://github.com/matrix-construct/construct
synced 2025-04-29 13:04:17 +02:00
modules/console: Add user rooms count cmd.
This commit is contained in:
parent
51cb09c31a
commit
77a8a3e3c9
1 changed files with 27 additions and 0 deletions
|
@ -11340,6 +11340,33 @@ console_cmd__user__rooms(opt &out, const string_view &line)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
console_cmd__user__rooms__count(opt &out, const string_view &line)
|
||||
{
|
||||
const params param{line, " ",
|
||||
{
|
||||
"user_id", "[membership]"
|
||||
}};
|
||||
|
||||
const m::user &user
|
||||
{
|
||||
param.at(0)
|
||||
};
|
||||
|
||||
const string_view &membership
|
||||
{
|
||||
param[1]
|
||||
};
|
||||
|
||||
const m::user::rooms rooms
|
||||
{
|
||||
user
|
||||
};
|
||||
|
||||
out << rooms.count(membership) << std::endl;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
console_cmd__user__rooms__origins(opt &out, const string_view &line)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue