diff --git a/spec/integ/crypto/olm-utils.ts b/spec/integ/crypto/olm-utils.ts index 30ae501329..178b54366b 100644 --- a/spec/integ/crypto/olm-utils.ts +++ b/spec/integ/crypto/olm-utils.ts @@ -305,7 +305,9 @@ export function encryptMegolmEventRawPlainText(opts: { }, type: "m.room.encrypted", unsigned: {}, - state_key: opts.plaintext.state_key ? `${opts.plaintext.type}:${opts.plaintext.state_key}` : undefined, + state_key: opts.plaintext.hasOwnProperty("state_key") + ? `${opts.plaintext.type}:${opts.plaintext.state_key}` + : undefined, }; } diff --git a/spec/test-utils/test-utils.ts b/spec/test-utils/test-utils.ts index 5067e4dff6..6921922900 100644 --- a/spec/test-utils/test-utils.ts +++ b/spec/test-utils/test-utils.ts @@ -82,7 +82,7 @@ export function getSyncResponse( state_key: "", content: { "algorithm": "m.megolm.v1.aes-sha2", - "io.element.msc3414.encrypt_state_events": encryptStateEvents, + "io.element.msc4362.encrypt_state_events": encryptStateEvents, }, }), ], diff --git a/src/@types/state_events.ts b/src/@types/state_events.ts index 0eb650556a..c84fad69a6 100644 --- a/src/@types/state_events.ts +++ b/src/@types/state_events.ts @@ -106,7 +106,7 @@ export interface RoomPinnedEventsEventContent { export interface RoomEncryptionEventContent { "algorithm": "m.megolm.v1.aes-sha2"; - "io.element.msc3414.encrypt_state_events"?: boolean; + "io.element.msc4362.encrypt_state_events"?: boolean; "rotation_period_ms"?: number; "rotation_period_msgs"?: number; } diff --git a/src/client.ts b/src/client.ts index 26cba498fe..1ed09b6eca 100644 --- a/src/client.ts +++ b/src/client.ts @@ -6928,7 +6928,7 @@ export class MatrixClient extends TypedEventEmitterundefined for message events. * @returns The event's `state_key`. */ @@ -766,7 +766,7 @@ export class MatrixEvent extends TypedEventEmitterundefined + * MSC4362 if the state event is encrypted. This will return undefined * for message events. * @returns The event's `state_key`. */ diff --git a/src/rust-crypto/rust-crypto.ts b/src/rust-crypto/rust-crypto.ts index dbb0abf7c3..a32ffbe20f 100644 --- a/src/rust-crypto/rust-crypto.ts +++ b/src/rust-crypto/rust-crypto.ts @@ -164,7 +164,7 @@ export class RustCrypto extends TypedEventEmitter