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

modules/console: Add user rooms command.

This commit is contained in:
Jason Volk 2018-04-13 14:04:36 -07:00
parent 45f8239f9b
commit d07da44718

View file

@ -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)
{ {