Merge pull request #1029 from matrix-org/luke/fix-multi-welcome-user

Don't do a deferred start chat if user is welcome user
This commit is contained in:
David Baker 2017-06-05 13:45:01 +01:00 committed by GitHub
commit cdd8cc41e2

View file

@ -721,13 +721,17 @@ module.exports = React.createClass({
); );
// Use a deferred action to reshow the dialog once the user has registered // Use a deferred action to reshow the dialog once the user has registered
if (MatrixClientPeg.get().isGuest()) { if (MatrixClientPeg.get().isGuest()) {
dis.dispatch({ // No point in making 2 DMs with welcome bot. This assumes view_set_mxid will
action: 'do_after_sync_prepared', // result in a new DM with the welcome user.
deferred_action: { if (userId !== this.props.config.welcomeUserId) {
action: 'view_start_chat_or_reuse', dis.dispatch({
user_id: userId, action: 'do_after_sync_prepared',
}, deferred_action: {
}); action: 'view_start_chat_or_reuse',
user_id: userId,
},
});
}
dis.dispatch({ dis.dispatch({
action: 'view_set_mxid', action: 'view_set_mxid',
}); });