From 27fa21e403a2a60477ae1ad073c27280246efd05 Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 5 Sep 2018 18:08:49 +0100 Subject: [PATCH] Replace view_set_mxid with require_registration To put all the other flows through the to-ilag-or-not-to-ilag flow --- src/components/structures/GroupView.js | 4 ++-- src/components/structures/MatrixChat.js | 2 +- src/components/structures/RightPanel.js | 2 +- src/components/structures/RoomDirectory.js | 2 +- src/components/structures/RoomView.js | 4 ++-- src/components/views/room_settings/ColorSettings.js | 2 +- src/components/views/rooms/MemberInfo.js | 2 +- src/components/views/rooms/MessageComposer.js | 2 +- src/createRoom.js | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/components/structures/GroupView.js b/src/components/structures/GroupView.js index 9498c2aa2a..d104019a01 100644 --- a/src/components/structures/GroupView.js +++ b/src/components/structures/GroupView.js @@ -480,7 +480,7 @@ export default React.createClass({ group_id: groupId, }, }); - dis.dispatch({action: 'view_set_mxid'}); + dis.dispatch({action: 'require_registration'}); willDoOnboarding = true; } this.setState({ @@ -724,7 +724,7 @@ export default React.createClass({ _onJoinClick: async function() { if (this._matrixClient.isGuest()) { - dis.dispatch({action: 'view_set_mxid'}); + dis.dispatch({action: 'require_registration'}); return; } diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index 002e439454..333e200e44 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -1428,7 +1428,7 @@ export default React.createClass({ } else if (screen == 'start') { this.showScreen('home'); dis.dispatch({ - action: 'view_set_mxid', + action: 'require_registration', }); } else if (screen == 'directory') { dis.dispatch({ diff --git a/src/components/structures/RightPanel.js b/src/components/structures/RightPanel.js index bd4ed722cb..47b3df65cb 100644 --- a/src/components/structures/RightPanel.js +++ b/src/components/structures/RightPanel.js @@ -160,7 +160,7 @@ module.exports = React.createClass({ onInviteButtonClick: function() { if (this.context.matrixClient.isGuest()) { - dis.dispatch({action: 'view_set_mxid'}); + dis.dispatch({action: 'require_registration'}); return; } diff --git a/src/components/structures/RoomDirectory.js b/src/components/structures/RoomDirectory.js index 76360383d6..f417932fd0 100644 --- a/src/components/structures/RoomDirectory.js +++ b/src/components/structures/RoomDirectory.js @@ -354,7 +354,7 @@ module.exports = React.createClass({ // to the directory. if (MatrixClientPeg.get().isGuest()) { if (!room.world_readable && !room.guest_can_join) { - dis.dispatch({action: 'view_set_mxid'}); + dis.dispatch({action: 'require_registration'}); return; } } diff --git a/src/components/structures/RoomView.js b/src/components/structures/RoomView.js index ca06243ed1..54f730de5d 100644 --- a/src/components/structures/RoomView.js +++ b/src/components/structures/RoomView.js @@ -915,7 +915,7 @@ module.exports = React.createClass({ dis.dispatch({action: 'focus_composer'}); if (MatrixClientPeg.get().isGuest()) { - dis.dispatch({action: 'view_set_mxid'}); + dis.dispatch({action: 'require_registration'}); return; } @@ -946,7 +946,7 @@ module.exports = React.createClass({ injectSticker: function(url, info, text) { if (MatrixClientPeg.get().isGuest()) { - dis.dispatch({action: 'view_set_mxid'}); + dis.dispatch({action: 'require_registration'}); return; } diff --git a/src/components/views/room_settings/ColorSettings.js b/src/components/views/room_settings/ColorSettings.js index e82d3ffb0a..30621f9c15 100644 --- a/src/components/views/room_settings/ColorSettings.js +++ b/src/components/views/room_settings/ColorSettings.js @@ -90,7 +90,7 @@ module.exports = React.createClass({ secondary_color: this.state.secondary_color, }).catch(function(err) { if (err.errcode === 'M_GUEST_ACCESS_FORBIDDEN') { - dis.dispatch({action: 'view_set_mxid'}); + dis.dispatch({action: 'require_registration'}); } }); } diff --git a/src/components/views/rooms/MemberInfo.js b/src/components/views/rooms/MemberInfo.js index c635f09e2c..e6e6350083 100644 --- a/src/components/views/rooms/MemberInfo.js +++ b/src/components/views/rooms/MemberInfo.js @@ -429,7 +429,7 @@ module.exports = withMatrixClient(React.createClass({ console.log("Mod toggle success"); }, function(err) { if (err.errcode === 'M_GUEST_ACCESS_FORBIDDEN') { - dis.dispatch({action: 'view_set_mxid'}); + dis.dispatch({action: 'require_registration'}); } else { console.error("Toggle moderator error:" + err); Modal.createTrackedDialog('Failed to toggle moderator status', '', ErrorDialog, { diff --git a/src/components/views/rooms/MessageComposer.js b/src/components/views/rooms/MessageComposer.js index dacd433e3e..642c939f83 100644 --- a/src/components/views/rooms/MessageComposer.js +++ b/src/components/views/rooms/MessageComposer.js @@ -131,7 +131,7 @@ export default class MessageComposer extends React.Component { onUploadClick(ev) { if (MatrixClientPeg.get().isGuest()) { - dis.dispatch({action: 'view_set_mxid'}); + dis.dispatch({action: 'require_registration'}); return; } diff --git a/src/createRoom.js b/src/createRoom.js index a767d09288..8b4220fc85 100644 --- a/src/createRoom.js +++ b/src/createRoom.js @@ -42,7 +42,7 @@ function createRoom(opts) { const client = MatrixClientPeg.get(); if (client.isGuest()) { - dis.dispatch({action: 'view_set_mxid'}); + dis.dispatch({action: 'require_registration'}); return Promise.resolve(null); }