0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-17 07:20:55 +01:00

modules/m_room_history_visibility: Add some more rules for node visibility.

This commit is contained in:
Jason Volk 2019-04-27 17:23:37 -07:00
parent 80fb8699a1
commit 43e36861cc

View file

@ -64,7 +64,21 @@ _visible_(const m::event &event,
room
};
return origins.has(node_id.host());
// Allow joined servers
if(origins.has(node_id.host()))
return true;
// Allow auth chain events XXX: this is too broad
if(m::event::auth::is_power_event(event))
return true;
// Allow any event where the state_key string is a user mxid and the server
// is the host of that user. Note that applies to any type of event.
if(m::valid(m::id::USER, json::get<"state_key"_>(event)))
if(m::user::id(at<"state_key"_>(event)).host() == node_id.host())
return true;
return false;
}
static bool