Remove support for unstable private read receipts (#9225)

t3chguy/dedup-icons-17oct
Šimon Brandner 2022-09-12 18:04:16 +02:00 committed by GitHub
parent e52ef4522d
commit 28a418dd2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -30,7 +30,6 @@ import { ClientEvent } from "matrix-js-sdk/src/client";
import { Thread } from 'matrix-js-sdk/src/models/thread';
import { ReceiptType } from "matrix-js-sdk/src/@types/read_receipts";
import { MatrixError } from 'matrix-js-sdk/src/http-api';
import { getPrivateReadReceiptField } from "matrix-js-sdk/src/utils";
import SettingsStore from "../../settings/SettingsStore";
import { Layout } from "../../settings/enums/Layout";
@ -983,13 +982,15 @@ class TimelinePanel extends React.Component<IProps, IState> {
).catch(async (e) => {
// /read_markers API is not implemented on this HS, fallback to just RR
if (e.errcode === 'M_UNRECOGNIZED' && lastReadEvent) {
const privateField = await getPrivateReadReceiptField(MatrixClientPeg.get());
if (!sendRRs && !privateField) return;
if (
!sendRRs
&& !MatrixClientPeg.get().doesServerSupportUnstableFeature("org.matrix.msc2285.stable")
) return;
try {
return await MatrixClientPeg.get().sendReadReceipt(
lastReadEvent,
sendRRs ? ReceiptType.Read : privateField,
sendRRs ? ReceiptType.Read : ReceiptType.ReadPrivate,
);
} catch (error) {
logger.error(e);

View File

@ -127,8 +127,7 @@ export default class PreferencesUserSettingsTab extends React.Component<IProps,
public async componentDidMount(): Promise<void> {
this.setState({
disablingReadReceiptsSupported: (
await MatrixClientPeg.get().doesServerSupportUnstableFeature("org.matrix.msc2285.stable") ||
await MatrixClientPeg.get().doesServerSupportUnstableFeature("org.matrix.msc2285")
await MatrixClientPeg.get().doesServerSupportUnstableFeature("org.matrix.msc2285.stable")
),
});
}