0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-07-05 10:08:36 +02:00

modules/console: Add console cmd to iterate public rooms via interface.

This commit is contained in:
Jason Volk 2018-10-24 16:51:39 -07:00
parent 72bfd645da
commit 2174a66ea9

View file

@ -5184,6 +5184,34 @@ console_cmd__rooms(opt &out, const string_view &line)
return true;
}
bool
console_cmd__rooms__public(opt &out, const string_view &line)
{
const params param{line, " ",
{
"server|room_id_lb", "limit"
}};
const string_view &key
{
param.at("server|room_id_lb", string_view{})
};
auto limit
{
param.at("limit", 32L)
};
m::rooms::for_each_public(key, [&limit, &out]
(const m::room::id &room_id) -> bool
{
out << room_id << std::endl;
return --limit > 0;
});
return true;
}
bool
console_cmd__rooms__fetch(opt &out, const string_view &line)
{