Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Disable "Publish this room" option in invite only rooms #7441

Merged
merged 4 commits into from
Jan 10, 2022
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/components/views/room_settings/RoomPublishSetting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,12 @@ export default class RoomPublishSetting extends React.PureComponent<IProps, ISta
render() {
const client = MatrixClientPeg.get();

const room = client.getRoom(this.props.roomId);
const isRoomPublishable = room.getJoinRule() !== "invite";

const enabled = (
DirectoryCustomisations.requireCanonicalAliasAccessToPublish?.() === false ||
this.props.canSetCanonicalAlias
(DirectoryCustomisations.requireCanonicalAliasAccessToPublish?.() === false ||
this.props.canSetCanonicalAlias) && (isRoomPublishable || this.state.isRoomPublished)
);

return (
Expand Down