You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-12-22 09:02:11 +03:00
Update MSC3827 implementation to not change the default behaviour (#8936)
This commit is contained in:
@@ -103,12 +103,9 @@ function refIsForRecentlyViewed(ref: RefObject<HTMLElement>): boolean {
|
|||||||
return ref.current?.id?.startsWith("mx_SpotlightDialog_button_recentlyViewed_") === true;
|
return ref.current?.id?.startsWith("mx_SpotlightDialog_button_recentlyViewed_") === true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getRoomTypes(showRooms: boolean, showSpaces: boolean): Set<RoomType | null> | null {
|
function getRoomTypes(showRooms: boolean, showSpaces: boolean): Set<RoomType | null> {
|
||||||
const roomTypes = new Set<RoomType | null>();
|
const roomTypes = new Set<RoomType | null>();
|
||||||
|
|
||||||
// This is what servers not implementing MSC3827 are expecting
|
|
||||||
if (showRooms && !showSpaces) return null;
|
|
||||||
|
|
||||||
if (showRooms) roomTypes.add(null);
|
if (showRooms) roomTypes.add(null);
|
||||||
if (showSpaces) roomTypes.add(RoomType.Space);
|
if (showSpaces) roomTypes.add(RoomType.Space);
|
||||||
|
|
||||||
|
|||||||
@@ -91,7 +91,9 @@ export const usePublicRoomDirectory = () => {
|
|||||||
if (query || roomTypes) {
|
if (query || roomTypes) {
|
||||||
opts.filter = {
|
opts.filter = {
|
||||||
"generic_search_term": query,
|
"generic_search_term": query,
|
||||||
"org.matrix.msc3827.room_types": roomTypes ? Array.from<RoomType | null>(roomTypes) : null,
|
"org.matrix.msc3827.room_types": await MatrixClientPeg.get().doesServerSupportUnstableFeature(
|
||||||
|
"org.matrix.msc3827",
|
||||||
|
) ? Array.from<RoomType | null>(roomTypes) : null,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user