diff --git a/src/components/views/rooms/RoomSettings.js b/src/components/views/rooms/RoomSettings.js index 3642fbca42..10af37ebf0 100644 --- a/src/components/views/rooms/RoomSettings.js +++ b/src/components/views/rooms/RoomSettings.js @@ -36,11 +36,11 @@ module.exports = React.createClass({ tags[tagName] = {}; }); - var are_notifications_muted = false; + var areNotifsMuted = false; var roomPushRule = MatrixClientPeg.get().getRoomPushRule("global", this.props.room.roomId); if (roomPushRule) { if (0 <= roomPushRule.actions.indexOf("dont_notify")) { - are_notifications_muted = true; + areNotifsMuted = true; } } @@ -53,7 +53,7 @@ module.exports = React.createClass({ power_levels_changed: false, tags_changed: false, tags: tags, - areNotifsMuted: are_notifications_muted + areNotifsMuted: areNotifsMuted }; }, @@ -192,10 +192,10 @@ module.exports = React.createClass({ _getPowerLevels: function() { if (!this.state.power_levels_changed) return undefined; - var power_levels = this.props.room.currentState.getStateEvents('m.room.power_levels', ''); - power_levels = power_levels.getContent(); + var powerLevels = this.props.room.currentState.getStateEvents('m.room.power_levels', ''); + powerLevels = powerLevels ? powerLevels.getContent() : {}; - var new_power_levels = { + var newPowerLevels = { ban: parseInt(this.refs.ban.getValue()), kick: parseInt(this.refs.kick.getValue()), redact: parseInt(this.refs.redact.getValue()), @@ -203,11 +203,11 @@ module.exports = React.createClass({ events_default: parseInt(this.refs.events_default.getValue()), state_default: parseInt(this.refs.state_default.getValue()), users_default: parseInt(this.refs.users_default.getValue()), - users: power_levels.users, - events: power_levels.events, + users: powerLevels.users, + events: powerLevels.events, }; - return new_power_levels; + return newPowerLevels; }, onPowerLevelsChanged: function() { @@ -269,12 +269,9 @@ module.exports = React.createClass({ var PowerSelector = sdk.getComponent('elements.PowerSelector'); var power_levels = this.props.room.currentState.getStateEvents('m.room.power_levels', ''); - var events_levels = (power_levels ? power_levels.events : {}) || {}; - var user_id = MatrixClientPeg.get().credentials.userId; - if (power_levels) { power_levels = power_levels.getContent(); @@ -332,15 +329,14 @@ module.exports = React.createClass({ if (events_levels['m.room.canonical_alias'] !== undefined) { canonical_alias_level = events_levels['m.room.canonical_alias']; } - var can_set_canonical_alias = current_user_level >= canonical_alias_level; - - var can_set_tag = true; + var canSetCanonicalAlias = current_user_level >= canonical_alias_level; + var canSetTag = true; var self = this; - var user_levels_section; + var userLevelsSection; if (Object.keys(user_levels).length) { - user_levels_section = + userLevelsSection =

Privileged Users

; } else { - user_levels_section =
No users have specific privileges in this room.
+ userLevelsSection =
No users have specific privileges in this room.
} var banned = this.props.room.getMembersWithMembership("ban"); - var banned_users_section; + var bannedUsersSection; if (banned.length) { - banned_users_section = + bannedUsersSection =

Banned users

; } - var create_event = this.props.room.currentState.getStateEvents('m.room.create', ''); - var unfederatable_section; - if (create_event.getContent()["m.federate"] === false) { - unfederatable_section =
Ths room is not accessible by remote Matrix servers.
+ var unfederatableSection; + if (this._yankValueFromEvent("m.room.create", "m.federate") === false) { + unfederatableSection = ( +
+ Ths room is not accessible by remote Matrix servers. +
+ ); } // TODO: support editing custom events_levels @@ -396,10 +395,10 @@ module.exports = React.createClass({ } }); - var tags_section = + var tagsSection =
Tagged as: - { can_set_tag ? + { canSetTag ? tags.map(function(tag, i) { return (