mirror of
https://github.com/matrix-construct/construct
synced 2025-01-14 00:34:18 +01:00
modules/console: Add a user mitsein command.
This commit is contained in:
parent
5870f1d90b
commit
c1e3b9f405
1 changed files with 40 additions and 0 deletions
|
@ -10790,6 +10790,46 @@ console_cmd__user__sees(opt &out, const string_view &line)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
console_cmd__user__mitsein(opt &out, const string_view &line)
|
||||
{
|
||||
const params param{line, " ",
|
||||
{
|
||||
"user_id_a", "user_id_b", "membership"
|
||||
}};
|
||||
|
||||
const m::user user_a
|
||||
{
|
||||
m::user(param.at("user_id_a"))
|
||||
};
|
||||
|
||||
const m::user user_b
|
||||
{
|
||||
m::user(param.at("user_id_b"))
|
||||
};
|
||||
|
||||
const string_view membership
|
||||
{
|
||||
param.at("membership", "join"_sv)
|
||||
};
|
||||
|
||||
const m::user::mitsein mitsein
|
||||
{
|
||||
user_a
|
||||
};
|
||||
|
||||
mitsein.for_each(user_b, membership, [&out]
|
||||
(const m::room &room, const string_view &membership)
|
||||
{
|
||||
out << room.room_id
|
||||
<< std::endl;
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
console_cmd__user__tokens(opt &out, const string_view &line)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue