Implement MSC3827: Filtering of /publicRooms by room type (#8866)

This commit is contained in:
Šimon Brandner 2022-06-24 17:08:00 +02:00 committed by GitHub
parent 18c21d77cd
commit 663bca559f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 96 additions and 21 deletions

View file

@ -29,6 +29,7 @@ import { useLocalEcho } from "../../../hooks/useLocalEcho";
import JoinRuleSettings from "../settings/JoinRuleSettings";
import { useRoomState } from "../../../hooks/useRoomState";
import SettingsFieldset from "../settings/SettingsFieldset";
import { useAsyncMemo } from "../../../hooks/useAsyncMemo";
interface IProps {
matrixClient: MatrixClient;
@ -38,6 +39,9 @@ interface IProps {
const SpaceSettingsVisibilityTab = ({ matrixClient: cli, space, closeSettingsFn }: IProps) => {
const [error, setError] = useState("");
const serverSupportsExploringSpaces = useAsyncMemo<boolean>(async () => {
return cli.doesServerSupportUnstableFeature("org.matrix.msc3827");
}, [cli], false);
const userId = cli.getUserId();
@ -103,7 +107,7 @@ const SpaceSettingsVisibilityTab = ({ matrixClient: cli, space, closeSettingsFn
canSetCanonicalAlias={canSetCanonical}
canSetAliases={true}
canonicalAliasEvent={canonicalAliasEv}
hidePublishSetting={true}
hidePublishSetting={!serverSupportsExploringSpaces}
/>
</>;
}