diff --git a/python/tests/test_0_complex_or_slow.py b/python/tests/test_0_complex_or_slow.py index 11f8dd6c36..360cfbb105 100644 --- a/python/tests/test_0_complex_or_slow.py +++ b/python/tests/test_0_complex_or_slow.py @@ -652,15 +652,6 @@ def test_verified_group_vs_delete_server_after(acfactory, tmp_path, lp): chat2.send_text("hi2") lp.sec("ac2_offl: receiving message") - ev = ac2_offl._evtracker.get_matching("DC_EVENT_INCOMING_MSG|DC_EVENT_MSGS_CHANGED") - msg_in = ac2_offl.get_message_by_id(ev.data2) - assert msg_in.is_system_message() - assert msg_in.text == "Messages are guaranteed to be end-to-end encrypted from now on." - - # We need to consume one event that has data2=0 - ev = ac2_offl._evtracker.get_matching("DC_EVENT_INCOMING_MSG|DC_EVENT_MSGS_CHANGED") - assert ev.data2 == 0 - ev = ac2_offl._evtracker.get_matching("DC_EVENT_INCOMING_MSG|DC_EVENT_MSGS_CHANGED") msg_in = ac2_offl.get_message_by_id(ev.data2) assert not msg_in.is_system_message() diff --git a/src/receive_imf.rs b/src/receive_imf.rs index 12a0d8099d..d33c0d1fd5 100644 --- a/src/receive_imf.rs +++ b/src/receive_imf.rs @@ -2454,7 +2454,10 @@ async fn mark_recipients_as_verified( peerstate.set_verified(PeerstateKeyType::GossipKey, fp, verifier_addr)?; peerstate.save_to_db(&context.sql).await?; - if !is_verified { + if context + .get_config_bool(Config::VerifiedOneOnOneChats) + .await? + { let (to_contact_id, _) = Contact::add_or_lookup( context, "", diff --git a/src/securejoin.rs b/src/securejoin.rs index f4f1d6d09a..471cd6da8b 100644 --- a/src/securejoin.rs +++ b/src/securejoin.rs @@ -616,12 +616,17 @@ pub(crate) async fn observe_securejoin_on_other_device( peerstate.prefer_encrypt = EncryptPreference::Mutual; peerstate.save_to_db(&context.sql).await.unwrap_or_default(); - ChatId::set_protection_for_contact( - context, - contact_id, - mime_message.timestamp_sent, - ) - .await?; + if context + .get_config_bool(Config::VerifiedOneOnOneChats) + .await? + { + ChatId::set_protection_for_contact( + context, + contact_id, + mime_message.timestamp_sent, + ) + .await?; + } } else if let Some(fingerprint) = mime_message.get_header(HeaderDef::SecureJoinFingerprint) {