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
A supplied roomId property, will make the dialog use that room for the invites, rather than creating a new one
This commit is contained in:
@@ -37,6 +37,7 @@ module.exports = React.createClass({
|
||||
]),
|
||||
value: React.PropTypes.string,
|
||||
placeholder: React.PropTypes.string,
|
||||
roomId: React.PropTypes.string,
|
||||
button: React.PropTypes.string,
|
||||
focus: React.PropTypes.bool,
|
||||
onFinished: React.PropTypes.func.isRequired
|
||||
@@ -189,6 +190,17 @@ module.exports = React.createClass({
|
||||
},
|
||||
|
||||
_startChat: function(addr) {
|
||||
if (this.props.roomId) {
|
||||
Invite.inviteToRoom(this.props.roomId, addr).catch(function(err) {
|
||||
var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
||||
Modal.createDialog(ErrorDialog, {
|
||||
title: "Failure to invite user",
|
||||
description: err.toString()
|
||||
});
|
||||
return null;
|
||||
})
|
||||
.done();
|
||||
} else {
|
||||
// Start the chat
|
||||
createRoom().then(function(roomId) {
|
||||
return Invite.inviteToRoom(roomId, addr);
|
||||
@@ -202,6 +214,7 @@ module.exports = React.createClass({
|
||||
return null;
|
||||
})
|
||||
.done();
|
||||
}
|
||||
|
||||
// Close - this will happen before the above, as that is async
|
||||
this.props.onFinished(true, addr);
|
||||
|
||||
Reference in New Issue
Block a user