hide thread events from the timeline

This commit is contained in:
Germain Souquet 2021-08-17 11:10:02 +01:00
parent e5024c4b71
commit d1dbfbd014
7 changed files with 110 additions and 11 deletions

View file

@ -173,6 +173,8 @@ interface IProps {
onUnfillRequest?(backwards: boolean, scrollToken: string): void;
getRelationsForEvent?(eventId: string, relationType: string, eventType: string): Relations;
hideThreadedMessages?: boolean;
}
interface IState {
@ -443,6 +445,11 @@ export default class MessagePanel extends React.Component<IProps, IState> {
// Always show highlighted event
if (this.props.highlightedEventId === mxEv.getId()) return true;
const threadingEnabled = SettingsStore.getValue("feature_threading");
if (threadingEnabled && mxEv.replyEventId && this.props.hideThreadedMessages === true) {
return false;
}
return !shouldHideEvent(mxEv, this.context);
}