Merge pull request #824 from t3chguy/fix_hide_rr_abstraction

move user settings outward and use built in read receipts disabling
This commit is contained in:
Matthew Hodgson 2017-04-22 15:53:07 +01:00 committed by GitHub
commit 7e07ffd55f
2 changed files with 5 additions and 4 deletions

View file

@ -26,6 +26,7 @@ var q = require("q");
var classNames = require("classnames"); var classNames = require("classnames");
var Matrix = require("matrix-js-sdk"); var Matrix = require("matrix-js-sdk");
var UserSettingsStore = require('../../UserSettingsStore');
var MatrixClientPeg = require("../../MatrixClientPeg"); var MatrixClientPeg = require("../../MatrixClientPeg");
var ContentMessages = require("../../ContentMessages"); var ContentMessages = require("../../ContentMessages");
var Modal = require("../../Modal"); var Modal = require("../../Modal");
@ -1727,7 +1728,7 @@ module.exports = React.createClass({
var messagePanel = ( var messagePanel = (
<TimelinePanel ref={this._gatherTimelinePanelRef} <TimelinePanel ref={this._gatherTimelinePanelRef}
timelineSet={this.state.room.getUnfilteredTimelineSet()} timelineSet={this.state.room.getUnfilteredTimelineSet()}
manageReadReceipts={true} manageReadReceipts={!UserSettingsStore.getSyncedSetting('hideReadReceipts', false)}
manageReadMarkers={true} manageReadMarkers={true}
hidden={hideMessagePanel} hidden={hideMessagePanel}
highlightedEventId={this.props.highlightedEventId} highlightedEventId={this.props.highlightedEventId}

View file

@ -23,7 +23,6 @@ var Modal = require('../../../Modal');
var sdk = require('../../../index'); var sdk = require('../../../index');
var TextForEvent = require('../../../TextForEvent'); var TextForEvent = require('../../../TextForEvent');
import WithMatrixClient from '../../../wrappers/WithMatrixClient'; import WithMatrixClient from '../../../wrappers/WithMatrixClient';
import * as UserSettingsStore from "../../../UserSettingsStore";
var ContextualMenu = require('../../structures/ContextualMenu'); var ContextualMenu = require('../../structures/ContextualMenu');
import dis from '../../../dispatcher'; import dis from '../../../dispatcher';
@ -285,8 +284,9 @@ module.exports = WithMatrixClient(React.createClass({
}, },
getReadAvatars: function() { getReadAvatars: function() {
// return early if the user doesn't want any read receipts
if (UserSettingsStore.getSyncedSetting('hideReadReceipts', false)) { // return early if there are no read receipts
if (!this.props.readReceipts || this.props.readReceipts.length === 0) {
return (<span className="mx_EventTile_readAvatars"></span>); return (<span className="mx_EventTile_readAvatars"></span>);
} }