mirror of
https://github.com/matrix-construct/construct
synced 2024-10-01 13:18:58 +02:00
modules/federation/event_auth: Make an exception to the visibility for cases.
This commit is contained in:
parent
20385e2677
commit
5860a395a0
1 changed files with 24 additions and 1 deletions
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue