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

View file

@ -23,7 +23,6 @@ var Modal = require('../../../Modal');
var sdk = require('../../../index');
var TextForEvent = require('../../../TextForEvent');
import WithMatrixClient from '../../../wrappers/WithMatrixClient';
import * as UserSettingsStore from "../../../UserSettingsStore";
var ContextualMenu = require('../../structures/ContextualMenu');
import dis from '../../../dispatcher';
@ -285,8 +284,9 @@ module.exports = WithMatrixClient(React.createClass({
},
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>);
}