pass user settings from above
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
4b34a2b169
commit
c53fb08453
2 changed files with 8 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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 (
|
||||
<MessagePanel ref="messagePanel"
|
||||
hidden={ this.props.hidden }
|
||||
hideJoinLeaves={ this.state.hideJoinLeaves }
|
||||
hideRedactions={ this.state.hideRedactions }
|
||||
backPaginating={ this.state.backPaginating }
|
||||
forwardPaginating={ forwardPaginating }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue