0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-30 15:58:20 +02:00

ircd:Ⓜ️:visible: Minor move conditional return before present room construction.

This commit is contained in:
Jason Volk 2020-04-03 16:57:56 -07:00
parent 89be45b42f
commit dd9157315c

View file

@ -106,6 +106,11 @@ ircd::m::visible_to_user(const m::room &room,
// or for graceful forward compatibility. We default to "shared" here. // or for graceful forward compatibility. We default to "shared" here.
//assert(history_visibility == "shared"); //assert(history_visibility == "shared");
// If the room is not at the present event then we have to run another
// test for membership here. Otherwise the "join" test already failed.
if(!room.event_id)
return false;
// An m::room instance with no event_id is used to query the room at the // An m::room instance with no event_id is used to query the room at the
// present state. // present state.
const m::room present const m::room present
@ -113,11 +118,6 @@ ircd::m::visible_to_user(const m::room &room,
room.room_id room.room_id
}; };
// If the room is not at the present event then we have to run another
// test for membership here. Otherwise the "join" test already failed.
if(!room.event_id)
return false;
return m::membership(present, user_id, m::membership_positive); // join || invite return m::membership(present, user_id, m::membership_positive); // join || invite
} }