Merge pull request #458 from matrix-org/dbkr/createdoom_dm
Update createRoom to support creating DM rooms
This commit is contained in:
commit
f6478f111a
4 changed files with 38 additions and 23 deletions
|
@ -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, {
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue