You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-10 09:22:25 +03:00
Update createRoom to support creating DM rooms
* Make ChatInviteDialog and MemberInfo createRoom use it * Fix bug in setDMRoom
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user