mirror of
https://github.com/matrix-construct/construct
synced 2024-11-16 15:00:51 +01:00
modules/console: Add user rooms command.
This commit is contained in:
parent
45f8239f9b
commit
d07da44718
1 changed files with 34 additions and 0 deletions
|
@ -2203,6 +2203,40 @@ console_cmd__user__presence(opt &out, const string_view &line)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
console_cmd__user__rooms(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
|
||||||
|
};
|
||||||
|
|
||||||
|
rooms.for_each(membership, m::user::rooms::closure{[&out]
|
||||||
|
(const m::room &room, const string_view &membership)
|
||||||
|
{
|
||||||
|
out << room.room_id
|
||||||
|
<< " " << membership
|
||||||
|
<< std::endl;
|
||||||
|
}});
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
console_cmd__user__read(opt &out, const string_view &line)
|
console_cmd__user__read(opt &out, const string_view &line)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue