Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Remove support for unstable private read receipts (#9225)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonBrandner authored Sep 12, 2022
1 parent e52ef45 commit 28a418d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
9 changes: 5 additions & 4 deletions src/components/structures/TimelinePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
),
});
}
Expand Down

0 comments on commit 28a418d

Please sign in to comment.