Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion spec/integ/crypto/olm-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
}

Expand Down
2 changes: 1 addition & 1 deletion spec/test-utils/test-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
}),
],
Expand Down
2 changes: 1 addition & 1 deletion src/@types/state_events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6928,7 +6928,7 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
return;
}

// Check if the event is excluded under MSC3414
// Check if the event is excluded under MSC4362
if (
[
"m.room.create",
Expand Down
4 changes: 2 additions & 2 deletions src/models/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@ export class MatrixEvent extends TypedEventEmitter<MatrixEventEmittedEvents, Mat

/**
* Get the event state_key if it has one. If necessary, this will perform
* string-unpacking on the state key, as per MSC3414. This will return
* string-unpacking on the state key, as per MSC4362. This will return
* <code>undefined</code> for message events.
* @returns The event's `state_key`.
*/
Expand All @@ -766,7 +766,7 @@ export class MatrixEvent extends TypedEventEmitter<MatrixEventEmittedEvents, Mat

/**
* Get the raw event state_key if it has one. This may be string-packed as per
* MSC3414 if the state event is encrypted. This will return <code>undefined
* MSC4362 if the state event is encrypted. This will return <code>undefined
* </code> for message events.
* @returns The event's `state_key`.
*/
Expand Down
4 changes: 2 additions & 2 deletions src/rust-crypto/rust-crypto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export class RustCrypto extends TypedEventEmitter<RustCryptoEvents, CryptoEventH
/** Crypto callbacks provided by the application */
private readonly cryptoCallbacks: CryptoCallbacks,

/** Enable support for encrypted state events under MSC3414. */
/** Enable support for encrypted state events under MSC4362. */
private readonly enableEncryptedStateEvents: boolean = false,
) {
super();
Expand Down Expand Up @@ -1774,7 +1774,7 @@ export class RustCrypto extends TypedEventEmitter<RustCryptoEvents, CryptoEventH
return;
}

if (config["io.element.msc3414.encrypt_state_events"] && this.enableEncryptedStateEvents) {
if (config["io.element.msc4362.encrypt_state_events"] && this.enableEncryptedStateEvents) {
this.logger.info("crypto Enabling state event encryption...");
settings.encryptStateEvents = true;
}
Expand Down