diff --git a/src/components/views/rooms/RoomSettings.js b/src/components/views/rooms/RoomSettings.js index eca4dc074b..5a2d124531 100644 --- a/src/components/views/rooms/RoomSettings.js +++ b/src/components/views/rooms/RoomSettings.js @@ -321,18 +321,18 @@ module.exports = React.createClass({ var state_default = (parseInt(power_levels ? power_levels.state_default : 0) || 0); - var room_aliases_level = state_default; - if (events_levels['m.room.aliases'] !== undefined) { - room_aliases_level = events_levels['m.room.aliases']; + var canSetEventType = function(eventType) { + if (MatrixClientPeg.get().isGuest()) { + return false; + } + var level = state_default; + if (events_levels[eventType] !== undefined) { + level = events_levels[eventType]; + } + return current_user_level >= level; } - var can_set_room_aliases = current_user_level >= room_aliases_level; - var canonical_alias_level = state_default; - if (events_levels['m.room.canonical_alias'] !== undefined) { - canonical_alias_level = events_levels['m.room.canonical_alias']; - } - var canSetCanonicalAlias = current_user_level >= canonical_alias_level; - var canSetTag = true; + var canSetTag = !MatrixClientPeg.get().isGuest(); var self = this; @@ -409,7 +409,7 @@ module.exports = React.createClass({ onChange={ self._onTagChange.bind(self, tag.name) }/> { tag.label } ); - }) : tags.map(function(tag) { return tag.label; }).join(", ") + }) : (self.state.tags && self.state.tags.join) ? self.state.tags.join(", ") : "None" } @@ -425,16 +425,20 @@ module.exports = React.createClass({