mirror of
https://github.com/chatmail/core.git
synced 2026-05-14 12:26:31 +03:00
sync force_encryption
This commit is contained in:
@@ -507,7 +507,11 @@ impl Config {
|
||||
pub(crate) fn is_synced(&self) -> bool {
|
||||
matches!(
|
||||
self,
|
||||
Self::Displayname | Self::MdnsEnabled | Self::Selfavatar | Self::Selfstatus,
|
||||
Self::Displayname
|
||||
| Self::MdnsEnabled
|
||||
| Self::Selfavatar
|
||||
| Self::Selfstatus
|
||||
| Self::ForceEncryption,
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
19
src/sync.rs
19
src/sync.rs
@@ -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(())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user