From e9afcec5b21c5b9934399d2c5e214918e3149754 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 2 Aug 2017 13:42:24 +0100 Subject: [PATCH] fix m.federate=false warning in room settings Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/views/rooms/RoomSettings.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/views/rooms/RoomSettings.js b/src/components/views/rooms/RoomSettings.js index d6a973f648..f3e2bd5b13 100644 --- a/src/components/views/rooms/RoomSettings.js +++ b/src/components/views/rooms/RoomSettings.js @@ -408,11 +408,12 @@ module.exports = React.createClass({ _yankValueFromEvent: function(stateEventType, keyName, defaultValue) { // E.g.("m.room.name","name") would yank the "name" content key from "m.room.name" - var event = this.props.room.currentState.getStateEvents(stateEventType, ''); + const event = this.props.room.currentState.getStateEvents(stateEventType, ''); if (!event) { return defaultValue; } - return event.getContent()[keyName] || defaultValue; + const content = event.getContent(); + return keyName in content ? content[keyName] : defaultValue; }, _onHistoryRadioToggle: function(ev) { @@ -704,7 +705,7 @@ module.exports = React.createClass({ } var unfederatableSection; - if (this._yankValueFromEvent("m.room.create", "m.federate") === false) { + if (this._yankValueFromEvent("m.room.create", "m.federate", true) === false) { unfederatableSection = (
{ _t('This room is not accessible by remote Matrix servers') }.