From c53fb084539630881245c0f7de3c0c29d1fbdf8c Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 15 Jun 2017 20:02:17 +0100 Subject: [PATCH] pass user settings from above Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/structures/MessagePanel.js | 6 ++++-- src/components/structures/TimelinePanel.js | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/structures/MessagePanel.js b/src/components/structures/MessagePanel.js index 704ae228be..8b9ada14e7 100644 --- a/src/components/structures/MessagePanel.js +++ b/src/components/structures/MessagePanel.js @@ -20,7 +20,6 @@ import dis from "../../dispatcher"; import sdk from '../../index'; import MatrixClientPeg from '../../MatrixClientPeg'; -import UserSettingsStore from '../../UserSettingsStore'; const MILLIS_IN_DAY = 86400000; @@ -94,6 +93,9 @@ module.exports = React.createClass({ // hide redacted events as per old behaviour hideRedactions: React.PropTypes.bool, + + // hide membership joins and parts + hideJoinLeaves: React.PropTypes.bool, }, componentWillMount: function() { @@ -273,7 +275,7 @@ module.exports = React.createClass({ // this only applies to joins/leaves not invites/kicks/bans const isJoinOrLeave = membership === "join" || (membership === "leave" && mxEv.getStateKey() === mxEv.getSender()); - const hideJoinLeavesGlobally = UserSettingsStore.getSyncedSetting("hideJoinLeaves", false); + const hideJoinLeavesGlobally = this.props.hideJoinLeaves; if (isJoinOrLeave && hideJoinLeavesGlobally) { return false; } diff --git a/src/components/structures/TimelinePanel.js b/src/components/structures/TimelinePanel.js index 928e2405aa..9642887fd5 100644 --- a/src/components/structures/TimelinePanel.js +++ b/src/components/structures/TimelinePanel.js @@ -184,6 +184,9 @@ var TimelinePanel = React.createClass({ // hide redacted events as per old behaviour hideRedactions: syncedSettings.hideRedactions, + + // hide membership joins and leaves + hideJoinLeaves: syncedSettings.hideJoinLeaves, }; }, @@ -1122,6 +1125,7 @@ var TimelinePanel = React.createClass({ return (