You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-25 05:23:13 +03:00
Remove support for unstable private read receipts (#2624)
This commit is contained in:
14
src/utils.ts
14
src/utils.ts
@@ -24,7 +24,7 @@ import unhomoglyph from "unhomoglyph";
|
||||
import promiseRetry from "p-retry";
|
||||
|
||||
import type * as NodeCrypto from "crypto";
|
||||
import { MatrixClient, MatrixEvent } from ".";
|
||||
import { MatrixEvent } from ".";
|
||||
import { M_TIMESTAMP } from "./@types/location";
|
||||
import { ReceiptType } from "./@types/read_receipts";
|
||||
|
||||
@@ -670,17 +670,7 @@ export function sortEventsByLatestContentTimestamp(left: MatrixEvent, right: Mat
|
||||
return getContentTimestampWithFallback(right) - getContentTimestampWithFallback(left);
|
||||
}
|
||||
|
||||
export async function getPrivateReadReceiptField(client: MatrixClient): Promise<ReceiptType | null> {
|
||||
if (await client.doesServerSupportUnstableFeature("org.matrix.msc2285.stable")) return ReceiptType.ReadPrivate;
|
||||
if (await client.doesServerSupportUnstableFeature("org.matrix.msc2285")) return ReceiptType.UnstableReadPrivate;
|
||||
return null;
|
||||
}
|
||||
|
||||
export function isSupportedReceiptType(receiptType: string): boolean {
|
||||
return [
|
||||
ReceiptType.Read,
|
||||
ReceiptType.ReadPrivate,
|
||||
ReceiptType.UnstableReadPrivate,
|
||||
].includes(receiptType as ReceiptType);
|
||||
return [ReceiptType.Read, ReceiptType.ReadPrivate].includes(receiptType as ReceiptType);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user