mirror of
https://github.com/element-hq/element-web
synced 2024-11-24 02:05:45 +03:00
Merge pull request #168 from matrix-org/dbkr/keypair_3pid_invites
Wire up support for keypair 3pid invites.
This commit is contained in:
commit
b384d8c91a
2 changed files with 16 additions and 4 deletions
|
@ -316,7 +316,7 @@ module.exports = React.createClass({
|
|||
});
|
||||
break;
|
||||
case 'view_room':
|
||||
this._viewRoom(payload.room_id, payload.show_settings, payload.event_id);
|
||||
this._viewRoom(payload.room_id, payload.show_settings, payload.event_id, payload.invite_sign_url);
|
||||
break;
|
||||
case 'view_prev_room':
|
||||
roomIndexDelta = -1;
|
||||
|
@ -353,6 +353,7 @@ module.exports = React.createClass({
|
|||
action: 'view_room',
|
||||
room_id: foundRoom.roomId,
|
||||
event_id: payload.event_id,
|
||||
invite_sign_url: payload.invite_sign_url,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
@ -363,6 +364,7 @@ module.exports = React.createClass({
|
|||
action: 'view_room',
|
||||
room_id: result.room_id,
|
||||
event_id: payload.event_id,
|
||||
invite_sign_url: payload.invite_sign_url,
|
||||
});
|
||||
});
|
||||
break;
|
||||
|
@ -438,7 +440,7 @@ module.exports = React.createClass({
|
|||
//
|
||||
// eventId is optional and will cause a switch to the context of that
|
||||
// particular event.
|
||||
_viewRoom: function(roomId, showSettings, eventId) {
|
||||
_viewRoom: function(roomId, showSettings, eventId, invite_sign_url) {
|
||||
// before we switch room, record the scroll state of the current room
|
||||
this._updateScrollMap();
|
||||
|
||||
|
@ -450,6 +452,7 @@ module.exports = React.createClass({
|
|||
highlightedEventId: eventId,
|
||||
initialEventPixelOffset: undefined,
|
||||
page_type: this.PageTypes.RoomView,
|
||||
inviteSignUrl: invite_sign_url,
|
||||
};
|
||||
|
||||
// if we aren't given an explicit event id, look for one in the
|
||||
|
@ -540,9 +543,11 @@ module.exports = React.createClass({
|
|||
action: 'view_room_alias',
|
||||
room_alias: self.starting_room_alias,
|
||||
event_id: self.starting_event_id,
|
||||
invite_sign_url: self.starting_room_invite_sign_url,
|
||||
});
|
||||
delete self.starting_room_alias;
|
||||
delete self.starting_event_id;
|
||||
delete self.starting_room_invite_sign_url;
|
||||
} else if (!self.state.page_type) {
|
||||
if (!self.state.currentRoom) {
|
||||
var firstRoom = null;
|
||||
|
@ -659,7 +664,6 @@ module.exports = React.createClass({
|
|||
action: 'start_post_registration',
|
||||
});
|
||||
} else if (screen.indexOf('room/') == 0) {
|
||||
|
||||
if (!this.state.logged_in && this.props.startingQueryParams.email) {
|
||||
console.log("Redirecting to email registration");
|
||||
this.showScreen("register");
|
||||
|
@ -676,10 +680,12 @@ module.exports = React.createClass({
|
|||
action: 'view_room_alias',
|
||||
room_alias: roomString,
|
||||
event_id: eventId,
|
||||
invite_sign_url: params.signurl,
|
||||
});
|
||||
} else {
|
||||
// Okay, we'll take you here soon...
|
||||
this.starting_room_alias = roomString;
|
||||
this.starting_room_invite_sign_url = params.signurl;
|
||||
this.starting_event_id = eventId;
|
||||
// ...but you're still going to have to log in.
|
||||
this.notifyNewScreen('login');
|
||||
|
@ -689,6 +695,7 @@ module.exports = React.createClass({
|
|||
action: 'view_room',
|
||||
room_id: roomString,
|
||||
event_id: eventId,
|
||||
invite_sign_url: params.signurl,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -875,6 +882,7 @@ module.exports = React.createClass({
|
|||
ref="roomView"
|
||||
roomId={this.state.currentRoom}
|
||||
eventId={this.state.initialEventId}
|
||||
inviteSignUrl={this.state.inviteSignUrl}
|
||||
highlightedEventId={this.state.highlightedEventId}
|
||||
eventPixelOffset={this.state.initialEventPixelOffset}
|
||||
key={this.state.currentRoom}
|
||||
|
|
|
@ -63,6 +63,10 @@ module.exports = React.createClass({
|
|||
|
||||
roomId: React.PropTypes.string.isRequired,
|
||||
|
||||
// The URL used to join this room from an email invite
|
||||
// (given as part of the link in the invite email)
|
||||
inviteSignUrl: React.PropTypes.string,
|
||||
|
||||
// id of an event to jump to. If not given, will go to the end of the
|
||||
// live timeline.
|
||||
eventId: React.PropTypes.string,
|
||||
|
@ -707,7 +711,7 @@ module.exports = React.createClass({
|
|||
}
|
||||
|
||||
display_name_promise.then(() => {
|
||||
return MatrixClientPeg.get().joinRoom(this.props.roomId)
|
||||
return MatrixClientPeg.get().joinRoom(this.props.roomId, { inviteSignUrl: this.props.inviteSignUrl } )
|
||||
}).done(function() {
|
||||
// It is possible that there is no Room yet if state hasn't come down
|
||||
// from /sync - joinRoom will resolve when the HTTP request to join succeeds,
|
||||
|
|
Loading…
Reference in a new issue