From bb2f4fb5e6b0a277dc8e0b247c9108f9bd4ca5ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Tue, 4 Oct 2022 09:38:23 +0200 Subject: [PATCH] Check for the spec version when determining private read receipt support (#9341) Co-authored-by: Travis Ralston --- src/components/structures/TimelinePanel.tsx | 3 ++- .../views/settings/tabs/user/PreferencesUserSettingsTab.tsx | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/structures/TimelinePanel.tsx b/src/components/structures/TimelinePanel.tsx index b14016d0be..1e262014c2 100644 --- a/src/components/structures/TimelinePanel.tsx +++ b/src/components/structures/TimelinePanel.tsx @@ -994,7 +994,8 @@ class TimelinePanel extends React.Component { if (e.errcode === 'M_UNRECOGNIZED' && lastReadEvent) { if ( !sendRRs - && !cli.doesServerSupportUnstableFeature("org.matrix.msc2285.stable") + && !(await cli.doesServerSupportUnstableFeature("org.matrix.msc2285.stable")) + && !(await cli.isVersionSupported("v1.4")) ) return; try { return await cli.sendReadReceipt( diff --git a/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.tsx b/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.tsx index 643a137306..1519e39a0d 100644 --- a/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.tsx +++ b/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.tsx @@ -125,9 +125,12 @@ export default class PreferencesUserSettingsTab extends React.Component { + const cli = MatrixClientPeg.get(); + this.setState({ disablingReadReceiptsSupported: ( - await MatrixClientPeg.get().doesServerSupportUnstableFeature("org.matrix.msc2285.stable") + (await cli.doesServerSupportUnstableFeature("org.matrix.msc2285.stable")) + || (await cli.isVersionSupported("v1.4")) ), }); }