mirror of
https://github.com/matrix-construct/construct
synced 2024-09-27 11:18:51 +02: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
|
const auto room_id
|
||||||
{
|
{
|
||||||
param["room_id"]?
|
param["room_id"] && !startswith(param["room_id"], '*')?
|
||||||
m::room_id(param["room_id"]):
|
m::room_id(param["room_id"]):
|
||||||
m::room::id::buf{}
|
m::room::id::buf{}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const bool all_rooms
|
||||||
|
{
|
||||||
|
param["room_id"] == "*"
|
||||||
|
};
|
||||||
|
|
||||||
|
const bool eye_track
|
||||||
|
{
|
||||||
|
param["room_id"] == "**"
|
||||||
|
|| !param["room_id"]
|
||||||
|
};
|
||||||
|
|
||||||
size_t limit
|
size_t limit
|
||||||
{
|
{
|
||||||
param.at("limit", 32UL)
|
param.at("limit", 32UL)
|
||||||
|
@ -12676,7 +12687,7 @@ console_cmd__user__read(opt &out, const string_view &line)
|
||||||
out << std::endl;
|
out << std::endl;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
if(!room_id)
|
if(all_rooms)
|
||||||
{
|
{
|
||||||
const m::room::state state
|
const m::room::state state
|
||||||
{
|
{
|
||||||
|
@ -12687,6 +12698,30 @@ console_cmd__user__read(opt &out, const string_view &line)
|
||||||
return true;
|
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
|
const m::room::state::space space
|
||||||
{
|
{
|
||||||
user_room
|
user_room
|
||||||
|
|
Loading…
Reference in a new issue