Skip to content

Commit 50f94eb

Browse files
committed
stop guests rom trying to blunder into non-guest rooms
1 parent 5794c30 commit 50f94eb

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

‎src/components/structures/RoomDirectory.js‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,17 @@ module.exports = React.createClass({
7979
}
8080
var oob_data = {};
8181
if (room) {
82+
if (MatrixClientPeg.get().isGuest()) {
83+
if (!room.world_readable && !room.guest_can_join) {
84+
var NeedToRegisterDialog = sdk.getComponent("dialogs.NeedToRegisterDialog");
85+
Modal.createDialog(NeedToRegisterDialog, {
86+
title: "Failed to join the room",
87+
description: "This room is inaccessible to guests. You may be able to join if you register."
88+
});
89+
return;
90+
}
91+
}
92+
8293
oob_data = {
8394
avatarUrl: room.avatar_url,
8495
// XXX: This logic is duplicated from the JS SDK which

0 commit comments

Comments
 (0)