From 28a418dd2a01441555ccb715f54e13a3d0b83dd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Mon, 12 Sep 2022 18:04:16 +0200 Subject: [PATCH] Remove support for unstable private read receipts (#9225) --- src/components/structures/TimelinePanel.tsx | 9 +++++---- .../settings/tabs/user/PreferencesUserSettingsTab.tsx | 3 +-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/structures/TimelinePanel.tsx b/src/components/structures/TimelinePanel.tsx index d90c671c71..1e3b207f0f 100644 --- a/src/components/structures/TimelinePanel.tsx +++ b/src/components/structures/TimelinePanel.tsx @@ -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 { ).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); diff --git a/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.tsx b/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.tsx index 2322d70510..643a137306 100644 --- a/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.tsx +++ b/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.tsx @@ -127,8 +127,7 @@ export default class PreferencesUserSettingsTab extends React.Component { 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") ), }); }