Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
RiotTranslate 2017-06-02 11:36:43 +00:00
commit bbd3c14089
4 changed files with 39 additions and 23 deletions

View file

@ -90,6 +90,9 @@ module.exports = React.createClass({
// show timestamps always // show timestamps always
alwaysShowTimestamps: React.PropTypes.bool, alwaysShowTimestamps: React.PropTypes.bool,
// hide redacted events as per old behaviour
hideRedactions: React.PropTypes.bool,
}, },
componentWillMount: function() { componentWillMount: function() {
@ -463,6 +466,8 @@ module.exports = React.createClass({
continuation = false; continuation = false;
} }
if (mxEv.isRedacted() && this.props.hideRedactions) return ret;
var eventId = mxEv.getId(); var eventId = mxEv.getId();
var highlight = (eventId == this.props.highlightedEventId); var highlight = (eventId == this.props.highlightedEventId);

View file

@ -131,6 +131,8 @@ var TimelinePanel = React.createClass({
} }
} }
const syncedSettings = UserSettingsStore.getSyncedSettings();
return { return {
events: [], events: [],
timelineLoading: true, // track whether our room timeline is loading timelineLoading: true, // track whether our room timeline is loading
@ -175,10 +177,13 @@ var TimelinePanel = React.createClass({
clientSyncState: MatrixClientPeg.get().getSyncState(), clientSyncState: MatrixClientPeg.get().getSyncState(),
// should the event tiles have twelve hour times // should the event tiles have twelve hour times
isTwelveHour: UserSettingsStore.getSyncedSetting('showTwelveHourTimestamps'), isTwelveHour: syncedSettings.showTwelveHourTimestamps,
// always show timestamps on event tiles? // always show timestamps on event tiles?
alwaysShowTimestamps: UserSettingsStore.getSyncedSetting('alwaysShowTimestamps'), alwaysShowTimestamps: syncedSettings.alwaysShowTimestamps,
// hide redacted events as per old behaviour
hideRedactions: syncedSettings.hideRedactions,
}; };
}, },
@ -1113,26 +1118,27 @@ var TimelinePanel = React.createClass({
); );
return ( return (
<MessagePanel ref="messagePanel" <MessagePanel ref="messagePanel"
hidden={ this.props.hidden } hidden={ this.props.hidden }
backPaginating={ this.state.backPaginating } hideRedactions={ this.state.hideRedactions }
forwardPaginating={ forwardPaginating } backPaginating={ this.state.backPaginating }
events={ this.state.events } forwardPaginating={ forwardPaginating }
highlightedEventId={ this.props.highlightedEventId } events={ this.state.events }
readMarkerEventId={ this.state.readMarkerEventId } highlightedEventId={ this.props.highlightedEventId }
readMarkerVisible={ this.state.readMarkerVisible } readMarkerEventId={ this.state.readMarkerEventId }
suppressFirstDateSeparator={ this.state.canBackPaginate } readMarkerVisible={ this.state.readMarkerVisible }
showUrlPreview = { this.props.showUrlPreview } suppressFirstDateSeparator={ this.state.canBackPaginate }
manageReadReceipts = { this.props.manageReadReceipts } showUrlPreview = { this.props.showUrlPreview }
ourUserId={ MatrixClientPeg.get().credentials.userId } manageReadReceipts = { this.props.manageReadReceipts }
stickyBottom={ stickyBottom } ourUserId={ MatrixClientPeg.get().credentials.userId }
onScroll={ this.onMessageListScroll } stickyBottom={ stickyBottom }
onFillRequest={ this.onMessageListFillRequest } onScroll={ this.onMessageListScroll }
onUnfillRequest={ this.onMessageListUnfillRequest } onFillRequest={ this.onMessageListFillRequest }
opacity={ this.props.opacity } onUnfillRequest={ this.onMessageListUnfillRequest }
isTwelveHour={ this.state.isTwelveHour } opacity={ this.props.opacity }
alwaysShowTimestamps={ this.state.alwaysShowTimestamps } isTwelveHour={ this.state.isTwelveHour }
className={ this.props.className } alwaysShowTimestamps={ this.state.alwaysShowTimestamps }
tileShape={ this.props.tileShape } className={ this.props.className }
tileShape={ this.props.tileShape }
/> />
); );
}, },

View file

@ -84,6 +84,10 @@ const SETTINGS_LABELS = [
id: 'useCompactLayout', id: 'useCompactLayout',
label: 'Use compact timeline layout', label: 'Use compact timeline layout',
}, },
{
id: 'hideRedactions',
label: 'Hide removed messages',
},
/* /*
{ {
id: 'useFixedWidthFont', id: 'useFixedWidthFont',

View file

@ -141,6 +141,7 @@
"Camera": "Camera", "Camera": "Camera",
"Advanced": "Advanced", "Advanced": "Advanced",
"Algorithm": "Algorithm", "Algorithm": "Algorithm",
"Hide removed messages": "Hide removed messages",
"Always show message timestamps": "Always show message timestamps", "Always show message timestamps": "Always show message timestamps",
"Authentication": "Authentication", "Authentication": "Authentication",
"all room members": "all room members", "all room members": "all room members",