allow seeing state from visibility=shared left rooms

This commit is contained in:
Benjamin Lee 2024-06-03 19:54:03 -07:00
parent 52af998f7b
commit 857131e959
No known key found for this signature in database
GPG key ID: FB9624E2885D55A4

View file

@ -280,6 +280,8 @@ impl Service {
) -> Result<bool> { ) -> Result<bool> {
let currently_member = let currently_member =
services().rooms.state_cache.is_joined(user_id, room_id)?; services().rooms.state_cache.is_joined(user_id, room_id)?;
let once_member =
services().rooms.state_cache.once_joined(user_id, room_id)?;
let history_visibility = self let history_visibility = self
.room_state_get( .room_state_get(
@ -299,8 +301,11 @@ impl Service {
}) })
})?; })?;
Ok(currently_member Ok(match history_visibility {
|| history_visibility == HistoryVisibility::WorldReadable) HistoryVisibility::WorldReadable => true,
HistoryVisibility::Shared => once_member,
_ => currently_member,
})
} }
/// Returns the state hash for this pdu. /// Returns the state hash for this pdu.