diff --git a/src/components/views/rooms/RoomSettings.js b/src/components/views/rooms/RoomSettings.js
index bbe90ee059..74b326e987 100644
--- a/src/components/views/rooms/RoomSettings.js
+++ b/src/components/views/rooms/RoomSettings.js
@@ -56,7 +56,7 @@ module.exports = React.createClass({
tags_changed: false,
tags: tags,
areNotifsMuted: areNotifsMuted,
- isRoomPublished: false, // updated in componentWillMount
+ // isRoomPublished: // set in componentWillMount
};
},
@@ -284,6 +284,11 @@ module.exports = React.createClass({
case "invite_only":
this.setState({
join_rule: "invite",
+ // we always set guests can_join here as it makes no sense to have
+ // an invite-only room that guests can't join. If you explicitly
+ // invite them, you clearly want them to join, whether they're a
+ // guest or not. In practice, guest_access should probably have
+ // been implemented as part of the join_rules enum.
guest_access: "can_join",
});
break;
@@ -330,6 +335,13 @@ module.exports = React.createClass({
});
},
+ mayChangeRoomAccess: function() {
+ var cli = MatrixClientPeg.get();
+ var roomState = this.props.room.currentState;
+ return (roomState.mayClientSendStateEvent("m.room.join_rules", cli) &&
+ roomState.mayClientSendStateEvent("m.room.guest_access", cli))
+ },
+
render: function() {
// TODO: go through greying out things you don't have permission to change
// (or turning them into informative stuff)
@@ -519,23 +531,21 @@ module.exports = React.createClass({
{ inviteGuestWarning }