mirror of
https://github.com/matrix-construct/construct
synced 2024-10-02 05:38:53 +02:00
modules/console: Add room visible diagnostic cmd.
This commit is contained in:
parent
499c6f4f21
commit
3b7df8069b
1 changed files with 48 additions and 0 deletions
|
@ -3879,6 +3879,54 @@ console_cmd__room__depth(opt &out, const string_view &line)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
console_cmd__room__visible(opt &out, const string_view &line)
|
||||||
|
{
|
||||||
|
const params param{line, " ",
|
||||||
|
{
|
||||||
|
"room_id", "user_id|node_id", "event_id"
|
||||||
|
}};
|
||||||
|
|
||||||
|
const auto &room_id
|
||||||
|
{
|
||||||
|
m::room_id(param.at(0))
|
||||||
|
};
|
||||||
|
|
||||||
|
const string_view &mxid
|
||||||
|
{
|
||||||
|
param[1] && param[1] != "*"?
|
||||||
|
param[1]:
|
||||||
|
param[1] == "*"?
|
||||||
|
string_view{}:
|
||||||
|
param[1]
|
||||||
|
};
|
||||||
|
|
||||||
|
const auto &event_id
|
||||||
|
{
|
||||||
|
param[2]
|
||||||
|
};
|
||||||
|
|
||||||
|
const m::room room
|
||||||
|
{
|
||||||
|
room_id, event_id
|
||||||
|
};
|
||||||
|
|
||||||
|
const bool visible
|
||||||
|
{
|
||||||
|
room.visible(mxid)
|
||||||
|
};
|
||||||
|
|
||||||
|
out << room_id << " is "
|
||||||
|
<< (visible? "VISIBLE" : "NOT VISIBLE")
|
||||||
|
<< (mxid? " to " : "")
|
||||||
|
<< mxid
|
||||||
|
<< (event_id? " at " : "")
|
||||||
|
<< event_id
|
||||||
|
<< std::endl;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
console_cmd__room__members(opt &out, const string_view &line)
|
console_cmd__room__members(opt &out, const string_view &line)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue