mirror of
https://github.com/Novaloop-AG/healthchat-web.git
synced 2026-11-06 22:48:21 +00:00
Show only preview buttons in directory for guest users
This aligns the room directory with the rest of Element Web so that it does not allow guest users to join rooms. Instead, we show preview buttons (even when the preview might not actually happen). Fixes https://github.com/vector-im/element-web/issues/16213
This commit is contained in:
@@ -487,7 +487,11 @@ export default class RoomDirectory extends React.Component {
|
|||||||
let previewButton;
|
let previewButton;
|
||||||
let joinOrViewButton;
|
let joinOrViewButton;
|
||||||
|
|
||||||
if (room.world_readable && !hasJoinedRoom) {
|
// Element Web currently does not allow guests to join rooms, so we
|
||||||
|
// instead show them preview buttons for all rooms. If the room is not
|
||||||
|
// world readable, a modal will appear asking you to register first. If
|
||||||
|
// it is readable, the preview appears as normal.
|
||||||
|
if (!hasJoinedRoom && (room.world_readable || isGuest)) {
|
||||||
previewButton = (
|
previewButton = (
|
||||||
<AccessibleButton kind="secondary" onClick={(ev) => this.onPreviewClick(ev, room)}>{_t("Preview")}</AccessibleButton>
|
<AccessibleButton kind="secondary" onClick={(ev) => this.onPreviewClick(ev, room)}>{_t("Preview")}</AccessibleButton>
|
||||||
);
|
);
|
||||||
@@ -496,7 +500,7 @@ export default class RoomDirectory extends React.Component {
|
|||||||
joinOrViewButton = (
|
joinOrViewButton = (
|
||||||
<AccessibleButton kind="secondary" onClick={(ev) => this.onViewClick(ev, room)}>{_t("View")}</AccessibleButton>
|
<AccessibleButton kind="secondary" onClick={(ev) => this.onViewClick(ev, room)}>{_t("View")}</AccessibleButton>
|
||||||
);
|
);
|
||||||
} else if (!isGuest || room.guest_can_join) {
|
} else if (!isGuest) {
|
||||||
joinOrViewButton = (
|
joinOrViewButton = (
|
||||||
<AccessibleButton kind="primary" onClick={(ev) => this.onJoinClick(ev, room)}>{_t("Join")}</AccessibleButton>
|
<AccessibleButton kind="primary" onClick={(ev) => this.onJoinClick(ev, room)}>{_t("Join")}</AccessibleButton>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user