From 50f94eb0402da92f8d6051ea53e4ee2d63a9663a Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Wed, 13 Apr 2016 13:33:16 +0100 Subject: [PATCH] stop guests rom trying to blunder into non-guest rooms --- src/components/structures/RoomDirectory.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/components/structures/RoomDirectory.js b/src/components/structures/RoomDirectory.js index 5c6042c2..f3614092 100644 --- a/src/components/structures/RoomDirectory.js +++ b/src/components/structures/RoomDirectory.js @@ -79,6 +79,17 @@ module.exports = React.createClass({ } var oob_data = {}; if (room) { + if (MatrixClientPeg.get().isGuest()) { + if (!room.world_readable && !room.guest_can_join) { + var NeedToRegisterDialog = sdk.getComponent("dialogs.NeedToRegisterDialog"); + Modal.createDialog(NeedToRegisterDialog, { + title: "Failed to join the room", + description: "This room is inaccessible to guests. You may be able to join if you register." + }); + return; + } + } + oob_data = { avatarUrl: room.avatar_url, // XXX: This logic is duplicated from the JS SDK which