0
0
Fork 0
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:
Jason Volk 2021-02-02 02:30:50 -08:00
parent e1db70ca04
commit 6424e0bde9

View file

@ -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'",