diff --git a/src/components/views/dialogs/spotlight/SpotlightDialog.tsx b/src/components/views/dialogs/spotlight/SpotlightDialog.tsx index f55575833c..7658a54399 100644 --- a/src/components/views/dialogs/spotlight/SpotlightDialog.tsx +++ b/src/components/views/dialogs/spotlight/SpotlightDialog.tsx @@ -103,12 +103,9 @@ function refIsForRecentlyViewed(ref: RefObject): boolean { return ref.current?.id?.startsWith("mx_SpotlightDialog_button_recentlyViewed_") === true; } -function getRoomTypes(showRooms: boolean, showSpaces: boolean): Set | null { +function getRoomTypes(showRooms: boolean, showSpaces: boolean): Set { const roomTypes = new Set(); - // This is what servers not implementing MSC3827 are expecting - if (showRooms && !showSpaces) return null; - if (showRooms) roomTypes.add(null); if (showSpaces) roomTypes.add(RoomType.Space); diff --git a/src/hooks/usePublicRoomDirectory.ts b/src/hooks/usePublicRoomDirectory.ts index 895c448834..46941ec052 100644 --- a/src/hooks/usePublicRoomDirectory.ts +++ b/src/hooks/usePublicRoomDirectory.ts @@ -91,7 +91,9 @@ export const usePublicRoomDirectory = () => { if (query || roomTypes) { opts.filter = { "generic_search_term": query, - "org.matrix.msc3827.room_types": roomTypes ? Array.from(roomTypes) : null, + "org.matrix.msc3827.room_types": await MatrixClientPeg.get().doesServerSupportUnstableFeature( + "org.matrix.msc3827", + ) ? Array.from(roomTypes) : null, }; }