From 7ca7aa1303ca1e2fc06eb6d669d63d6d3e6b30dd Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 15 Mar 2022 14:14:25 +0000 Subject: [PATCH] Merge pull request from GHSA-qmf4-7w7j-vf23 (#8059) Co-authored-by: J. Ryan Stinnett --- src/components/structures/ThreadPanel.tsx | 2 +- src/components/structures/ThreadView.tsx | 2 +- src/components/views/right_panel/TimelineCard.tsx | 2 +- src/contexts/RoomContext.ts | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/structures/ThreadPanel.tsx b/src/components/structures/ThreadPanel.tsx index c843e20cb5..ee917bb00e 100644 --- a/src/components/structures/ThreadPanel.tsx +++ b/src/components/structures/ThreadPanel.tsx @@ -318,7 +318,7 @@ const ThreadPanel: React.FC = ({ roomId, onClose, permalinkCreator }) => manageReadMarkers={false} // No RM support in thread's MVP sendReadReceiptOnLoad={false} // No RR support in thread's MVP timelineSet={timelineSet} - showUrlPreview={true} + showUrlPreview={false} // No URL previews at the threads list level empty={ setFilterOption(ThreadFilterType.All)} diff --git a/src/components/structures/ThreadView.tsx b/src/components/structures/ThreadView.tsx index bb993304b2..c8ad69bd81 100644 --- a/src/components/structures/ThreadView.tsx +++ b/src/components/structures/ThreadView.tsx @@ -351,7 +351,7 @@ export default class ThreadView extends React.Component { manageReadMarkers={true} sendReadReceiptOnLoad={true} timelineSet={this.state?.thread?.timelineSet} - showUrlPreview={true} + showUrlPreview={this.context.showUrlPreview} // ThreadView doesn't support IRC layout at this time layout={this.state.layout === Layout.Bubble ? Layout.Bubble : Layout.Group} hideThreadedMessages={false} diff --git a/src/components/views/right_panel/TimelineCard.tsx b/src/components/views/right_panel/TimelineCard.tsx index 72f3d42969..bd7d4361cb 100644 --- a/src/components/views/right_panel/TimelineCard.tsx +++ b/src/components/views/right_panel/TimelineCard.tsx @@ -248,7 +248,7 @@ export default class TimelineCard extends React.Component { manageReadMarkers={false} // No RM support in the TimelineCard sendReadReceiptOnLoad={true} timelineSet={this.props.timelineSet} - showUrlPreview={true} + showUrlPreview={this.context.showUrlPreview} // The right panel timeline (and therefore threads) don't support IRC layout at this time layout={this.state.layout === Layout.Bubble ? Layout.Bubble : Layout.Group} hideThreadedMessages={false} diff --git a/src/contexts/RoomContext.ts b/src/contexts/RoomContext.ts index 0c8f20686c..7665c656dd 100644 --- a/src/contexts/RoomContext.ts +++ b/src/contexts/RoomContext.ts @@ -60,6 +60,7 @@ const RoomContext = createContext({ showAvatarChanges: true, showDisplaynameChanges: true, matrixClientIsReady: false, + showUrlPreview: false, timelineRenderingType: TimelineRenderingType.Room, threadId: undefined, liveTimeline: undefined,