1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-26 17:03:12 +03:00

Fix backwards compatibility for redactEvent (#2039)

This commit is contained in:
Germain
2021-11-24 15:42:10 +00:00
committed by GitHub
parent ddd6a05198
commit 1c895432ed

View File

@@ -3698,24 +3698,24 @@ export class MatrixClient extends EventEmitter {
public redactEvent(
roomId: string,
eventId: string,
txnId?: string,
txnId?: string | undefined,
cbOrOpts?: Callback | IRedactOpts,
);
public redactEvent(
roomId: string,
threadId: string | null,
eventId: string,
txnId?: string,
txnId?: string | undefined,
cbOrOpts?: Callback | IRedactOpts,
);
public redactEvent(
roomId: string,
threadId: string | null,
eventId: string,
eventId?: string,
txnId?: string | Callback | IRedactOpts,
cbOrOpts?: Callback | IRedactOpts,
): Promise<ISendEventResponse> {
if (!threadId?.startsWith(EVENT_ID_PREFIX) && threadId !== null) {
if (!eventId || eventId.startsWith(EVENT_ID_PREFIX)) {
cbOrOpts = txnId as (Callback | IRedactOpts);
txnId = eventId;
eventId = threadId;