mirror of
https://github.com/matrix-construct/construct
synced 2024-11-25 08:12:37 +01:00
modules/console: Add argument for eye track diagnostic.
This commit is contained in:
parent
caf38d076a
commit
adb897a444
1 changed files with 37 additions and 2 deletions
|
@ -12600,11 +12600,22 @@ console_cmd__user__read(opt &out, const string_view &line)
|
|||
|
||||
const auto room_id
|
||||
{
|
||||
param["room_id"]?
|
||||
param["room_id"] && !startswith(param["room_id"], '*')?
|
||||
m::room_id(param["room_id"]):
|
||||
m::room::id::buf{}
|
||||
};
|
||||
|
||||
const bool all_rooms
|
||||
{
|
||||
param["room_id"] == "*"
|
||||
};
|
||||
|
||||
const bool eye_track
|
||||
{
|
||||
param["room_id"] == "**"
|
||||
|| !param["room_id"]
|
||||
};
|
||||
|
||||
size_t limit
|
||||
{
|
||||
param.at("limit", 32UL)
|
||||
|
@ -12676,7 +12687,7 @@ console_cmd__user__read(opt &out, const string_view &line)
|
|||
out << std::endl;
|
||||
}};
|
||||
|
||||
if(!room_id)
|
||||
if(all_rooms)
|
||||
{
|
||||
const m::room::state state
|
||||
{
|
||||
|
@ -12687,6 +12698,30 @@ console_cmd__user__read(opt &out, const string_view &line)
|
|||
return true;
|
||||
}
|
||||
|
||||
if(eye_track)
|
||||
{
|
||||
const m::room::type type
|
||||
{
|
||||
user_room, "ircd.read"
|
||||
};
|
||||
|
||||
type.for_each("ircd.read", [&each_event, &limit]
|
||||
(const auto &, const auto &, const auto &event_idx) -> bool
|
||||
{
|
||||
const m::event::fetch event
|
||||
{
|
||||
std::nothrow, event_idx
|
||||
};
|
||||
|
||||
if(likely(event.valid))
|
||||
each_event(event);
|
||||
|
||||
return --limit;
|
||||
});
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
const m::room::state::space space
|
||||
{
|
||||
user_room
|
||||
|
|
Loading…
Reference in a new issue