Skip to content

Commit 97064eb

Browse files
committed
sync force_encryption
1 parent c67dc51 commit 97064eb

2 files changed

Lines changed: 24 additions & 1 deletion

File tree

src/config.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,11 @@ impl Config {
507507
pub(crate) fn is_synced(&self) -> bool {
508508
matches!(
509509
self,
510-
Self::Displayname | Self::MdnsEnabled | Self::Selfavatar | Self::Selfstatus,
510+
Self::Displayname
511+
| Self::MdnsEnabled
512+
| Self::Selfavatar
513+
| Self::Selfstatus
514+
| Self::ForceEncryption,
511515
)
512516
}
513517

src/sync.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -810,4 +810,23 @@ mod tests {
810810
assert_eq!(msg.text, "Member Me added by alice@example.org.");
811811
Ok(())
812812
}
813+
814+
/// Tests that "force encryption" setting is synced.
815+
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
816+
async fn test_sync_force_encryption() -> Result<()> {
817+
let mut tcm = TestContextManager::new();
818+
let alice = &tcm.alice().await;
819+
let alice2 = &tcm.alice().await;
820+
alice.set_config_bool(Config::SyncMsgs, true).await?;
821+
alice2.set_config_bool(Config::SyncMsgs, true).await?;
822+
823+
assert_eq!(alice.get_config_bool(Config::ForceEncryption).await?, true);
824+
alice2
825+
.set_config_bool(Config::ForceEncryption, false)
826+
.await?;
827+
test_utils::sync(alice2, alice).await;
828+
assert_eq!(alice.get_config_bool(Config::ForceEncryption).await?, false);
829+
830+
Ok(())
831+
}
813832
}

0 commit comments

Comments
 (0)