feat: add option to force encryption

This commit is contained in:
link2xt
2026-05-19 22:40:28 +00:00
committed by l
parent 32e4a74050
commit d0696504d1
15 changed files with 179 additions and 23 deletions
+19
View File
@@ -810,4 +810,23 @@ mod tests {
assert_eq!(msg.text, "Member Me added by alice@example.org.");
Ok(())
}
/// Tests that "force encryption" setting is synced.
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn test_sync_force_encryption() -> Result<()> {
let mut tcm = TestContextManager::new();
let alice = &tcm.alice().await;
let alice2 = &tcm.alice().await;
alice.set_config_bool(Config::SyncMsgs, true).await?;
alice2.set_config_bool(Config::SyncMsgs, true).await?;
assert_eq!(alice.get_config_bool(Config::ForceEncryption).await?, true);
alice2
.set_config_bool(Config::ForceEncryption, false)
.await?;
test_utils::sync(alice2, alice).await;
assert_eq!(alice.get_config_bool(Config::ForceEncryption).await?, false);
Ok(())
}
}