Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #3083 from matrix-org/dbkr/remember_invited_room
Browse files Browse the repository at this point in the history
Remember we were trying to accept an invite
  • Loading branch information
dbkr authored Jun 10, 2019
2 parents 2e556b7 + 2c10557 commit f620b71
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
7 changes: 7 additions & 0 deletions src/components/structures/MatrixChat.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Copyright 2015, 2016 OpenMarket Ltd
Copyright 2017 Vector Creations Ltd
Copyright 2017-2019 New Vector Ltd
Copyright 2019 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -435,9 +436,15 @@ export default React.createClass({
break;
case 'start_registration':
// This starts the full registration flow
if (payload.screenAfterLogin) {
this._screenAfterLogin = payload.screenAfterLogin;
}
this._startRegistration(payload.params || {});
break;
case 'start_login':
if (payload.screenAfterLogin) {
this._screenAfterLogin = payload.screenAfterLogin;
}
this.setStateForNewView({
view: VIEWS.LOGIN,
});
Expand Down
2 changes: 2 additions & 0 deletions src/components/structures/RoomView.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Copyright 2015, 2016 OpenMarket Ltd
Copyright 2017 Vector Creations Ltd
Copyright 2018, 2019 New Vector Ltd
Copyright 2019 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -1552,6 +1553,7 @@ module.exports = React.createClass({
inviterName={inviterName}
invitedEmail={invitedEmail}
oobData={this.props.oobData}
signUrl={this.props.thirdPartyInvite ? this.props.thirdPartyInvite.inviteSignUrl : null}
room={this.state.room}
/>
</div>
Expand Down
21 changes: 19 additions & 2 deletions src/components/views/rooms/RoomPreviewBar.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*
Copyright 2015, 2016 OpenMarket Ltd
Copyright 2017 Vector Creations Ltd
Copyright 2019 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -57,6 +58,9 @@ module.exports = React.createClass({
// For third party invites, information passed about the room out-of-band
oobData: PropTypes.object,

// For third party invites, a URL for a 3pid invite signing service
signUrl: PropTypes.string,

// A standard client/server API error object. If supplied, indicates that the
// caller was unable to fetch details about the room for the given reason.
error: PropTypes.object,
Expand Down Expand Up @@ -228,12 +232,25 @@ module.exports = React.createClass({
return memberContent.membership === "invite" && memberContent.is_direct;
},

_makeScreenAfterLogin() {
return {
screen: 'room',
params: {
email: this.props.invitedEmail,
signurl: this.props.signUrl,
room_name: this.props.oobData.room_name,
room_avatar_url: this.props.oobData.avatarUrl,
inviter_name: this.props.oobData.inviterName,
}
};
},

onLoginClick: function() {
dis.dispatch({ action: 'start_login' });
dis.dispatch({ action: 'start_login', screenAfterLogin: this._makeScreenAfterLogin() });
},

onRegisterClick: function() {
dis.dispatch({ action: 'start_registration' });
dis.dispatch({ action: 'start_registration', screenAfterLogin: this._makeScreenAfterLogin() });
},

render: function() {
Expand Down

0 comments on commit f620b71

Please sign in to comment.