From 2845ac7ff0ef6d83c0a118986be2aa2eee36a844 Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Thu, 22 Jun 2023 18:13:51 -0500 Subject: [PATCH] Show `world_readable` rooms in the room directory See https://github.com/matrix-org/matrix-public-archive/issues/271#issuecomment-1602961486 --- server/lib/matrix-utils/fetch-public-rooms.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/server/lib/matrix-utils/fetch-public-rooms.js b/server/lib/matrix-utils/fetch-public-rooms.js index bc9e7c5..165f9c5 100644 --- a/server/lib/matrix-utils/fetch-public-rooms.js +++ b/server/lib/matrix-utils/fetch-public-rooms.js @@ -40,11 +40,12 @@ async function fetchPublicRooms( abortSignal, }); - // We only want to see public rooms in the archive + // We only want to see public or world_readable rooms in the archive. A room can be + // world_readable without being public. For example someone might have an invite only + // room where only privileged users are allowed to join and talk but anyone can view + // the room. const accessibleRooms = publicRoomsRes.chunk.filter((room) => { - // `room.world_readable` is also accessible here but we only use history - // `world_readable` to determine search indexing. - return room.join_rule === 'public'; + return room.world_readable || room.join_rule === 'public'; }); return {