mirror of
https://github.com/matrix-construct/construct
synced 2025-01-14 16:46:50 +01:00
modules/console: Add event visible diagnostic cmd.
This commit is contained in:
parent
3b7df8069b
commit
e798d81306
1 changed files with 32 additions and 0 deletions
|
@ -3299,6 +3299,38 @@ console_cmd__event__fetch(opt &out, const string_view &line)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
console_cmd__event__visible(opt &out, const string_view &line)
|
||||
{
|
||||
const params param{line, " ",
|
||||
{
|
||||
"event_id", "user_id|node_id"
|
||||
}};
|
||||
|
||||
const m::event::id &event_id
|
||||
{
|
||||
param.at(0)
|
||||
};
|
||||
|
||||
const string_view &mxid
|
||||
{
|
||||
param[1]
|
||||
};
|
||||
|
||||
const bool visible
|
||||
{
|
||||
m::visible(event_id, mxid)
|
||||
};
|
||||
|
||||
out << event_id << " is "
|
||||
<< (visible? "VISIBLE" : "NOT VISIBLE")
|
||||
<< (mxid? " to " : "")
|
||||
<< mxid
|
||||
<< std::endl;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//
|
||||
// state
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue