Remove threads labs flag and the ability to disable threads (#9878)

This commit is contained in:
Germain 2023-02-20 14:46:07 +00:00 committed by GitHub
parent a09e105c23
commit 8c22584f64
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
34 changed files with 197 additions and 501 deletions

View file

@ -57,7 +57,6 @@ import { IReadReceiptInfo } from "./ReadReceiptMarker";
import MessageActionBar from "../messages/MessageActionBar";
import ReactionsRow from "../messages/ReactionsRow";
import { getEventDisplayInfo } from "../../../utils/EventRenderingUtils";
import SettingsStore from "../../../settings/SettingsStore";
import { MessagePreviewStore } from "../../../stores/room-list/MessagePreviewStore";
import RoomContext, { TimelineRenderingType } from "../../../contexts/RoomContext";
import { MediaEventHelper } from "../../../utils/MediaEventHelper";
@ -381,9 +380,7 @@ export class UnwrappedEventTile extends React.Component<EventTileProps, IState>
}
}
if (SettingsStore.getValue("feature_threadenabled")) {
this.props.mxEvent.on(ThreadEvent.Update, this.updateThread);
}
this.props.mxEvent.on(ThreadEvent.Update, this.updateThread);
client.decryptEventIfNeeded(this.props.mxEvent);
@ -420,9 +417,7 @@ export class UnwrappedEventTile extends React.Component<EventTileProps, IState>
if (this.props.showReactions) {
this.props.mxEvent.removeListener(MatrixEventEvent.RelationsCreated, this.onReactionsCreated);
}
if (SettingsStore.getValue("feature_threadenabled")) {
this.props.mxEvent.off(ThreadEvent.Update, this.updateThread);
}
this.props.mxEvent.off(ThreadEvent.Update, this.updateThread);
}
public componentDidUpdate(prevProps: Readonly<EventTileProps>, prevState: Readonly<IState>): void {
@ -450,10 +445,6 @@ export class UnwrappedEventTile extends React.Component<EventTileProps, IState>
};
private get thread(): Thread | null {
if (!SettingsStore.getValue("feature_threadenabled")) {
return null;
}
let thread = this.props.mxEvent.getThread();
/**
* Accessing the threads value through the room due to a race condition

View file

@ -1,6 +1,6 @@
/*
Copyright 2015 OpenMarket Ltd
Copyright 2019 The Matrix.org Foundation C.I.C.
Copyright 2019 - 2023 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -68,7 +68,6 @@ export default class SearchResultTile extends React.Component<IProps> {
const layout = SettingsStore.getValue("layout");
const isTwelveHour = SettingsStore.getValue("showTwelveHourTimestamps");
const alwaysShowTimestamps = SettingsStore.getValue("alwaysShowTimestamps");
const threadsEnabled = SettingsStore.getValue("feature_threadenabled");
for (let j = 0; j < timeline.length; j++) {
const mxEv = timeline[j];
@ -85,13 +84,7 @@ export default class SearchResultTile extends React.Component<IProps> {
const continuation =
prevEv &&
!wantsDateSeparator(prevEv.getDate() || undefined, mxEv.getDate() || undefined) &&
shouldFormContinuation(
prevEv,
mxEv,
this.context?.showHiddenEvents,
threadsEnabled,
TimelineRenderingType.Search,
);
shouldFormContinuation(prevEv, mxEv, this.context?.showHiddenEvents, TimelineRenderingType.Search);
let lastInSection = true;
const nextEv = timeline[j + 1];
@ -107,7 +100,6 @@ export default class SearchResultTile extends React.Component<IProps> {
mxEv,
nextEv,
this.context?.showHiddenEvents,
threadsEnabled,
TimelineRenderingType.Search,
);
}

View file

@ -1,5 +1,5 @@
/*
Copyright 2019 - 2021 The Matrix.org Foundation C.I.C.
Copyright 2019 - 2023 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -443,7 +443,7 @@ export class SendMessageComposer extends React.Component<ISendMessageComposerPro
// For initial threads launch, chat effects are disabled
// see #19731
const isNotThread = this.props.relation?.rel_type !== THREAD_RELATION_TYPE.name;
if (!SettingsStore.getValue("feature_threadenabled") || isNotThread) {
if (isNotThread) {
dis.dispatch({ action: `effects.${effect.command}` });
}
}

View file

@ -1,5 +1,5 @@
/*
Copyright 2022 The Matrix.org Foundation C.I.C.
Copyright 2022 - 2023 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -112,7 +112,7 @@ export async function sendMessage(
// For initial threads launch, chat effects are disabled
// see #19731
const isNotThread = relation?.rel_type !== THREAD_RELATION_TYPE.name;
if (!SettingsStore.getValue("feature_threadenabled") || isNotThread) {
if (isNotThread) {
dis.dispatch({ action: `effects.${effect.command}` });
}
}