From 1f837d2ae154665f5cd7fe687d8285f7560e08d5 Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 14 Sep 2017 23:06:00 +0100 Subject: [PATCH] Make /join join again The auto_join parameter to view_room got broken at some point so /join took you to the room and then sat there like a lemon. Fixes https://github.com/vector-im/riot-web/issues/5029 --- src/components/structures/MatrixChat.js | 1 - src/stores/RoomViewStore.js | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index c142d6958c..1bdfb3e5f9 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -672,7 +672,6 @@ module.exports = React.createClass({ page_type: PageTypes.RoomView, thirdPartyInvite: roomInfo.third_party_invite, roomOobData: roomInfo.oob_data, - autoJoin: roomInfo.auto_join, }; if (roomInfo.room_alias) { diff --git a/src/stores/RoomViewStore.js b/src/stores/RoomViewStore.js index 17fcc97160..86a8d09234 100644 --- a/src/stores/RoomViewStore.js +++ b/src/stores/RoomViewStore.js @@ -134,6 +134,10 @@ class RoomViewStore extends Store { } this._setState(newState); + + if (payload.auto_join) { + this._joinRoom(payload); + } } else if (payload.room_alias) { // Resolve the alias and then do a second dispatch with the room ID acquired this._setState({ @@ -153,6 +157,7 @@ class RoomViewStore extends Store { event_id: payload.event_id, highlighted: payload.highlighted, room_alias: payload.room_alias, + auto_join: payload.auto_join, }); }, (err) => { dis.dispatch({