Skip to content

Commit 61d40bd

Browse files
committed
feat(crypto): Add RoomSettings::enable_encrypted_state_events (WASM SDK)
Signed-off-by: Skye Elliot <[email protected]>
1 parent a51bec6 commit 61d40bd

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

crates/matrix-sdk-crypto/src/machine/tests/room_settings.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ async fn test_stores_and_returns_room_settings() {
2323

2424
let settings = RoomSettings {
2525
algorithm: EventEncryptionAlgorithm::MegolmV1AesSha2,
26+
encrypt_state_events: false,
2627
only_allow_trusted_devices: true,
2728
session_rotation_period: Some(Duration::from_secs(10)),
2829
session_rotation_period_messages: Some(1234),

crates/matrix-sdk-crypto/src/store/integration_tests.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,6 +1163,7 @@ macro_rules! cryptostore_integration_tests {
11631163
let room_1 = room_id!("!test_1:localhost");
11641164
let settings_1 = RoomSettings {
11651165
algorithm: EventEncryptionAlgorithm::MegolmV1AesSha2,
1166+
encrypt_state_events: false,
11661167
only_allow_trusted_devices: true,
11671168
session_rotation_period: Some(Duration::from_secs(10)),
11681169
session_rotation_period_messages: Some(123),

crates/matrix-sdk-crypto/src/store/types.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,9 @@ pub struct RoomSettings {
411411
/// The encryption algorithm that should be used in the room.
412412
pub algorithm: EventEncryptionAlgorithm,
413413

414+
/// Whether state event encryption is enabled.
415+
pub encrypt_state_events: bool,
416+
414417
/// Should untrusted devices receive the room key, or should they be
415418
/// excluded from the conversation.
416419
pub only_allow_trusted_devices: bool,
@@ -428,6 +431,7 @@ impl Default for RoomSettings {
428431
fn default() -> Self {
429432
Self {
430433
algorithm: EventEncryptionAlgorithm::MegolmV1AesSha2,
434+
encrypt_state_events: false,
431435
only_allow_trusted_devices: false,
432436
session_rotation_period: None,
433437
session_rotation_period_messages: None,

0 commit comments

Comments
 (0)