|
1 | 1 | /* |
2 | | -Copyright 2016 - 2022 The Matrix.org Foundation C.I.C. |
| 2 | +Copyright 2016 - 2023 The Matrix.org Foundation C.I.C. |
3 | 3 |
|
4 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 5 | you may not use this file except in compliance with the License. |
@@ -75,7 +75,6 @@ export function shouldFormContinuation( |
75 | 75 | prevEvent: MatrixEvent | null, |
76 | 76 | mxEvent: MatrixEvent, |
77 | 77 | showHiddenEvents: boolean, |
78 | | - threadsEnabled: boolean, |
79 | 78 | timelineRenderingType?: TimelineRenderingType, |
80 | 79 | ): boolean { |
81 | 80 | if (timelineRenderingType === TimelineRenderingType.ThreadsList) return false; |
@@ -105,7 +104,6 @@ export function shouldFormContinuation( |
105 | 104 |
|
106 | 105 | // Thread summaries in the main timeline should break up a continuation on both sides |
107 | 106 | if ( |
108 | | - threadsEnabled && |
109 | 107 | (hasThreadSummary(mxEvent) || hasThreadSummary(prevEvent)) && |
110 | 108 | timelineRenderingType !== TimelineRenderingType.Thread |
111 | 109 | ) { |
@@ -259,7 +257,6 @@ export default class MessagePanel extends React.Component<IProps, IState> { |
259 | 257 | private readReceiptsByUserId: Record<string, IReadReceiptForUser> = {}; |
260 | 258 |
|
261 | 259 | private readonly _showHiddenEvents: boolean; |
262 | | - private readonly threadsEnabled: boolean; |
263 | 260 | private isMounted = false; |
264 | 261 |
|
265 | 262 | private readMarkerNode = createRef<HTMLLIElement>(); |
@@ -287,7 +284,6 @@ export default class MessagePanel extends React.Component<IProps, IState> { |
287 | 284 | // and we check this in a hot code path. This is also cached in our |
288 | 285 | // RoomContext, however we still need a fallback for roomless MessagePanels. |
289 | 286 | this._showHiddenEvents = SettingsStore.getValue("showHiddenEventsInTimeline"); |
290 | | - this.threadsEnabled = SettingsStore.getValue("feature_threadenabled"); |
291 | 287 |
|
292 | 288 | this.showTypingNotificationsWatcherRef = SettingsStore.watchSetting( |
293 | 289 | "showTypingNotifications", |
@@ -464,7 +460,7 @@ export default class MessagePanel extends React.Component<IProps, IState> { |
464 | 460 |
|
465 | 461 | // TODO: Implement granular (per-room) hide options |
466 | 462 | public shouldShowEvent(mxEv: MatrixEvent, forceHideEvents = false): boolean { |
467 | | - if (this.props.hideThreadedMessages && this.threadsEnabled && this.props.room) { |
| 463 | + if (this.props.hideThreadedMessages && this.props.room) { |
468 | 464 | const { shouldLiveInRoom } = this.props.room.eventShouldLiveIn(mxEv, this.props.events); |
469 | 465 | if (!shouldLiveInRoom) { |
470 | 466 | return false; |
@@ -720,25 +716,13 @@ export default class MessagePanel extends React.Component<IProps, IState> { |
720 | 716 | willWantDateSeparator || |
721 | 717 | mxEv.getSender() !== nextEv.getSender() || |
722 | 718 | getEventDisplayInfo(nextEv, this.showHiddenEvents).isInfoMessage || |
723 | | - !shouldFormContinuation( |
724 | | - mxEv, |
725 | | - nextEv, |
726 | | - this.showHiddenEvents, |
727 | | - this.threadsEnabled, |
728 | | - this.context.timelineRenderingType, |
729 | | - ); |
| 719 | + !shouldFormContinuation(mxEv, nextEv, this.showHiddenEvents, this.context.timelineRenderingType); |
730 | 720 | } |
731 | 721 |
|
732 | 722 | // is this a continuation of the previous message? |
733 | 723 | const continuation = |
734 | 724 | !wantsDateSeparator && |
735 | | - shouldFormContinuation( |
736 | | - prevEvent, |
737 | | - mxEv, |
738 | | - this.showHiddenEvents, |
739 | | - this.threadsEnabled, |
740 | | - this.context.timelineRenderingType, |
741 | | - ); |
| 725 | + shouldFormContinuation(prevEvent, mxEv, this.showHiddenEvents, this.context.timelineRenderingType); |
742 | 726 |
|
743 | 727 | const eventId = mxEv.getId(); |
744 | 728 | const highlight = eventId === this.props.highlightedEventId; |
|
0 commit comments