mirror of
https://github.com/matrix-construct/construct
synced 2024-11-28 17:52:54 +01:00
ircd:Ⓜ️ Add oper trapdoor to visibility check.
This commit is contained in:
parent
e1db70ca04
commit
6424e0bde9
1 changed files with 17 additions and 3 deletions
|
@ -55,12 +55,26 @@ ircd::m::visible(const m::event &event,
|
||||||
if(empty(mxid))
|
if(empty(mxid))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if(m::valid(m::id::USER, mxid))
|
|
||||||
return visible_to_user(room, history_visibility, mxid, event);
|
|
||||||
|
|
||||||
if(rfc3986::valid_remote(std::nothrow, mxid))
|
if(rfc3986::valid_remote(std::nothrow, mxid))
|
||||||
return visible_to_node(room, mxid, event);
|
return visible_to_node(room, mxid, event);
|
||||||
|
|
||||||
|
if(m::valid(m::id::USER, mxid))
|
||||||
|
{
|
||||||
|
const m::user::id user_id
|
||||||
|
{
|
||||||
|
mxid
|
||||||
|
};
|
||||||
|
|
||||||
|
if(visible_to_user(room, history_visibility, user_id, event))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
// Unrestricted visibility for opers
|
||||||
|
if(is_oper(user_id))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
throw m::UNSUPPORTED
|
throw m::UNSUPPORTED
|
||||||
{
|
{
|
||||||
"Cannot determine visibility of %s for '%s'",
|
"Cannot determine visibility of %s for '%s'",
|
||||||
|
|
Loading…
Reference in a new issue