From 5e105e1be6747340839dae0ac2d59013e17d5d1b Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Sun, 28 Aug 2016 14:04:02 +0100 Subject: [PATCH] make /user URLs work --- src/components/structures/MatrixChat.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index 839d59e2d9..84575b9e4f 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -69,6 +69,7 @@ module.exports = React.createClass({ UserSettings: "user_settings", CreateRoom: "create_room", RoomDirectory: "room_directory", + UserView: "user_view", }, AuxPanel: { @@ -87,6 +88,10 @@ module.exports = React.createClass({ // in the case where we view a room by ID or by RoomView when it resolves // what ID an alias points at. currentRoomId: null, + + // If we're trying to just view a user ID (i.e. /user URL), this is it + viewUserId: null, + logged_in: false, collapse_lhs: false, collapse_rhs: false, @@ -741,9 +746,11 @@ module.exports = React.createClass({ } } else if (screen.indexOf('user/') == 0) { var userId = screen.substring(5); + this.setState({ viewUserId: userId }); + this._setPage(this.PageTypes.UserView); + this.notifyNewScreen('user/' + userId); var member = new Matrix.RoomMember(null, userId); if (member) { - // FIXME: this doesn't work yet dis.dispatch({ action: 'view_user', member: member, @@ -1000,6 +1007,10 @@ module.exports = React.createClass({ page_element = right_panel = break; + case this.PageTypes.UserView: + page_element = null; // deliberately null for now + right_panel = + break; } var topBar;