Replace view_set_mxid with require_registration

To put all the other flows through the to-ilag-or-not-to-ilag flow
This commit is contained in:
David Baker 2018-09-05 18:08:49 +01:00
parent a042f4d0af
commit 27fa21e403
9 changed files with 11 additions and 11 deletions

View file

@ -480,7 +480,7 @@ export default React.createClass({
group_id: groupId, group_id: groupId,
}, },
}); });
dis.dispatch({action: 'view_set_mxid'}); dis.dispatch({action: 'require_registration'});
willDoOnboarding = true; willDoOnboarding = true;
} }
this.setState({ this.setState({
@ -724,7 +724,7 @@ export default React.createClass({
_onJoinClick: async function() { _onJoinClick: async function() {
if (this._matrixClient.isGuest()) { if (this._matrixClient.isGuest()) {
dis.dispatch({action: 'view_set_mxid'}); dis.dispatch({action: 'require_registration'});
return; return;
} }

View file

@ -1428,7 +1428,7 @@ export default React.createClass({
} else if (screen == 'start') { } else if (screen == 'start') {
this.showScreen('home'); this.showScreen('home');
dis.dispatch({ dis.dispatch({
action: 'view_set_mxid', action: 'require_registration',
}); });
} else if (screen == 'directory') { } else if (screen == 'directory') {
dis.dispatch({ dis.dispatch({

View file

@ -160,7 +160,7 @@ module.exports = React.createClass({
onInviteButtonClick: function() { onInviteButtonClick: function() {
if (this.context.matrixClient.isGuest()) { if (this.context.matrixClient.isGuest()) {
dis.dispatch({action: 'view_set_mxid'}); dis.dispatch({action: 'require_registration'});
return; return;
} }

View file

@ -354,7 +354,7 @@ module.exports = React.createClass({
// to the directory. // to the directory.
if (MatrixClientPeg.get().isGuest()) { if (MatrixClientPeg.get().isGuest()) {
if (!room.world_readable && !room.guest_can_join) { if (!room.world_readable && !room.guest_can_join) {
dis.dispatch({action: 'view_set_mxid'}); dis.dispatch({action: 'require_registration'});
return; return;
} }
} }

View file

@ -915,7 +915,7 @@ module.exports = React.createClass({
dis.dispatch({action: 'focus_composer'}); dis.dispatch({action: 'focus_composer'});
if (MatrixClientPeg.get().isGuest()) { if (MatrixClientPeg.get().isGuest()) {
dis.dispatch({action: 'view_set_mxid'}); dis.dispatch({action: 'require_registration'});
return; return;
} }
@ -946,7 +946,7 @@ module.exports = React.createClass({
injectSticker: function(url, info, text) { injectSticker: function(url, info, text) {
if (MatrixClientPeg.get().isGuest()) { if (MatrixClientPeg.get().isGuest()) {
dis.dispatch({action: 'view_set_mxid'}); dis.dispatch({action: 'require_registration'});
return; return;
} }

View file

@ -90,7 +90,7 @@ module.exports = React.createClass({
secondary_color: this.state.secondary_color, secondary_color: this.state.secondary_color,
}).catch(function(err) { }).catch(function(err) {
if (err.errcode === 'M_GUEST_ACCESS_FORBIDDEN') { if (err.errcode === 'M_GUEST_ACCESS_FORBIDDEN') {
dis.dispatch({action: 'view_set_mxid'}); dis.dispatch({action: 'require_registration'});
} }
}); });
} }

View file

@ -429,7 +429,7 @@ module.exports = withMatrixClient(React.createClass({
console.log("Mod toggle success"); console.log("Mod toggle success");
}, function(err) { }, function(err) {
if (err.errcode === 'M_GUEST_ACCESS_FORBIDDEN') { if (err.errcode === 'M_GUEST_ACCESS_FORBIDDEN') {
dis.dispatch({action: 'view_set_mxid'}); dis.dispatch({action: 'require_registration'});
} else { } else {
console.error("Toggle moderator error:" + err); console.error("Toggle moderator error:" + err);
Modal.createTrackedDialog('Failed to toggle moderator status', '', ErrorDialog, { Modal.createTrackedDialog('Failed to toggle moderator status', '', ErrorDialog, {

View file

@ -131,7 +131,7 @@ export default class MessageComposer extends React.Component {
onUploadClick(ev) { onUploadClick(ev) {
if (MatrixClientPeg.get().isGuest()) { if (MatrixClientPeg.get().isGuest()) {
dis.dispatch({action: 'view_set_mxid'}); dis.dispatch({action: 'require_registration'});
return; return;
} }

View file

@ -42,7 +42,7 @@ function createRoom(opts) {
const client = MatrixClientPeg.get(); const client = MatrixClientPeg.get();
if (client.isGuest()) { if (client.isGuest()) {
dis.dispatch({action: 'view_set_mxid'}); dis.dispatch({action: 'require_registration'});
return Promise.resolve(null); return Promise.resolve(null);
} }