Merge pull request #458 from matrix-org/dbkr/createdoom_dm

Update createRoom to support creating DM rooms
This commit is contained in:
David Baker 2016-09-12 18:29:43 +01:00 committed by GitHub
commit f6478f111a
4 changed files with 38 additions and 23 deletions

View file

@ -257,9 +257,7 @@ module.exports = React.createClass({
_startChat: function(addr) {
// Start the chat
createRoom().then(function(roomId) {
return Invite.inviteToRoom(roomId, addr);
})
createRoom({dmUserId: addr})
.catch(function(err) {
var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
Modal.createDialog(ErrorDialog, {

View file

@ -421,11 +421,7 @@ module.exports = React.createClass({
onNewDMClick: function() {
this.setState({ updating: this.state.updating + 1 });
createRoom({
createOpts: {
invite: [this.props.member.userId],
},
}).finally(() => {
createRoom({dmUserId: this.props.member.userId}).finally(() => {
this.props.onFinished();
this.setState({ updating: this.state.updating - 1 });
}).done();