when starting chat from memberinfo, allow guest access. in future synapse should make guest_access a default for the private_chat preset.

pull/21833/head
Matthew Hodgson 2016-03-20 12:39:49 +00:00
parent 68a391e24b
commit bbd57f2bdf
2 changed files with 15 additions and 1 deletions

View File

@ -467,6 +467,7 @@ module.exports = React.createClass({
var Loader = sdk.getComponent("elements.Spinner");
var modal = Modal.createDialog(Loader);
// XXX: FIXME: deduplicate this with MemberInfo's 'start chat' impl
MatrixClientPeg.get().createRoom({
preset: "private_chat",
// Allow guests by default since the room is private and they'd

View File

@ -248,8 +248,21 @@ module.exports = React.createClass({
else {
self.setState({ creatingRoom: true });
MatrixClientPeg.get().createRoom({
// XXX: FIXME: deduplicate this with "view_create_room" in MatrixChat
invite: [this.props.member.userId],
preset: "private_chat"
preset: "private_chat",
// Allow guests by default since the room is private and they'd
// need an invite. This means clicking on a 3pid invite email can
// actually drop you right in to a chat.
initial_state: [
{
content: {
guest_access: 'can_join'
},
type: 'm.room.guest_access',
state_key: '',
}
],
}).done(
function(res) {
self.setState({ creatingRoom: false });