diff --git a/CHANGELOG.md b/CHANGELOG.md index 07b14f765..11cb919e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ - maybe_add_time_based_warnings(): Use release date instead of the provider DB update one - Cleanly terminate deltachat-rpc-server. Also terminate on ctrl-c. +- Refactorings #4317 + ### Fixes - Fix python bindings README documentation on installing the bindings from source. diff --git a/src/contact.rs b/src/contact.rs index a9f48009c..78269f003 100644 --- a/src/contact.rs +++ b/src/contact.rs @@ -1195,9 +1195,7 @@ impl Contact { if peerstate.verified_key.is_some() { return Ok(VerifiedStatus::BidirectVerified); } - } - - if let Some(peerstate) = Peerstate::from_addr(context, &self.addr).await? { + } else if let Some(peerstate) = Peerstate::from_addr(context, &self.addr).await? { if peerstate.verified_key.is_some() { return Ok(VerifiedStatus::BidirectVerified); } diff --git a/src/qr.rs b/src/qr.rs index 920776b5e..f40b3786e 100644 --- a/src/qr.rs +++ b/src/qr.rs @@ -10,7 +10,7 @@ use percent_encoding::percent_decode_str; use serde::Deserialize; use self::dclogin_scheme::configure_from_login_qr; -use crate::chat::{self, get_chat_id_by_grpid, ChatIdBlocked}; +use crate::chat::{get_chat_id_by_grpid, ChatIdBlocked}; use crate::config::Config; use crate::constants::Blocked; use crate::contact::{ @@ -21,7 +21,6 @@ use crate::key::Fingerprint; use crate::message::Message; use crate::peerstate::Peerstate; use crate::socks::Socks5Config; -use crate::tools::time; use crate::{token, EventType}; const OPENPGP4FPR_SCHEME: &str = "OPENPGP4FPR:"; // yes: uppercase @@ -435,16 +434,9 @@ async fn decode_openpgp(context: &Context, qr: &str) -> Result { Contact::add_or_lookup(context, &name, peerstate_addr, Origin::UnhandledQrScan) .await .context("add_or_lookup")?; - let chat = ChatIdBlocked::get_for_contact(context, contact_id, Blocked::Request) + ChatIdBlocked::get_for_contact(context, contact_id, Blocked::Request) .await .context("Failed to create (new) chat for contact")?; - chat::add_info_msg( - context, - chat.id, - &format!("{} verified.", peerstate.addr), - time(), - ) - .await?; Ok(Qr::FprOk { contact_id }) } else { let contact_id = Contact::lookup_id_by_addr(context, &addr, Origin::Unknown)