0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-07-01 00:08:22 +02:00

modules/federation/event_auth: Make an exception to the visibility for cases.

This commit is contained in:
Jason Volk 2019-04-23 19:42:48 -07:00
parent 20385e2677
commit 5860a395a0

View file

@ -64,7 +64,30 @@ get__event_auth(client &client,
room_id, event_id
};
if(!room.visible(request.node_id))
bool visible
{
room.visible(request.node_id)
};
// make an exception to the visibility for invitee cases.
if(!visible)
{
static const m::event::fetch::opts fopts
{
m::event::keys::include {"type", "state_key", "content"}
};
const m::event::fetch event
{
event_id, fopts
};
if(at<"type"_>(event) == "m.room.member")
if(m::user::id(at<"state_key"_>(event)).host() == request.origin)
visible = true;
}
if(!visible)
throw m::ACCESS_DENIED
{
"You are not permitted to view the room at this event"