diff --git a/deltachat-rpc-client/tests/test_securejoin.py b/deltachat-rpc-client/tests/test_securejoin.py index f6cf29780..3d2d3f58a 100644 --- a/deltachat-rpc-client/tests/test_securejoin.py +++ b/deltachat-rpc-client/tests/test_securejoin.py @@ -28,7 +28,6 @@ def test_qr_setup_contact(acfactory) -> None: assert alice_contact_bob_snapshot.is_profile_verified -@pytest.mark.xfail() def test_qr_securejoin(acfactory): alice, bob = acfactory.get_online_accounts(2) diff --git a/src/securejoin.rs b/src/securejoin.rs index 6d57143d7..30e58009b 100644 --- a/src/securejoin.rs +++ b/src/securejoin.rs @@ -8,7 +8,7 @@ use percent_encoding::{utf8_percent_encode, AsciiSet, NON_ALPHANUMERIC}; use crate::aheader::EncryptPreference; use crate::chat::{self, Chat, ChatId, ChatIdBlocked, ProtectionStatus}; use crate::config::Config; -use crate::constants::{Blocked, Chattype}; +use crate::constants::Blocked; use crate::contact::{Contact, ContactId, Origin}; use crate::context::Context; use crate::e2ee::ensure_secret_key_exists; @@ -684,17 +684,17 @@ async fn secure_connection_established( .get_config_bool(Config::VerifiedOneOnOneChats) .await? { - let chat = Chat::load_from_db(context, chat_id).await?; - if chat.typ == Chattype::Single { - chat_id - .set_protection( - context, - ProtectionStatus::Protected, - time(), - Some(contact_id), - ) - .await?; - } + let private_chat_id = ChatIdBlocked::get_for_contact(context, contact_id, Blocked::Yes) + .await? + .id; + private_chat_id + .set_protection( + context, + ProtectionStatus::Protected, + time(), + Some(contact_id), + ) + .await?; } context.emit_event(EventType::ChatModified(chat_id)); Ok(()) diff --git a/src/securejoin/bob.rs b/src/securejoin/bob.rs index 1d0898d3a..e6862f575 100644 --- a/src/securejoin/bob.rs +++ b/src/securejoin/bob.rs @@ -228,9 +228,8 @@ impl BobState { if context .get_config_bool(Config::VerifiedOneOnOneChats) .await? - && chat_id == self.alice_chat() { - chat_id + self.alice_chat() .set_protection( context, ProtectionStatus::Protected,