1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-11-13 08:02:38 +03:00

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
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();