mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 17:36:29 +03:00
Small verification fixes (#4317)
* Small performance improvement by not unnecessarily loading the peerstate
* Remove wrong info message "{contact} verified" when scanning a QR code with just an email
I think that this was a bug in the original C code and then slipped
through two refactorings.
This commit is contained in:
@@ -11,6 +11,8 @@
|
|||||||
- maybe_add_time_based_warnings(): Use release date instead of the provider DB update one
|
- maybe_add_time_based_warnings(): Use release date instead of the provider DB update one
|
||||||
- Cleanly terminate deltachat-rpc-server.
|
- Cleanly terminate deltachat-rpc-server.
|
||||||
Also terminate on ctrl-c.
|
Also terminate on ctrl-c.
|
||||||
|
- Refactorings #4317
|
||||||
|
|
||||||
|
|
||||||
### Fixes
|
### Fixes
|
||||||
- Fix python bindings README documentation on installing the bindings from source.
|
- Fix python bindings README documentation on installing the bindings from source.
|
||||||
|
|||||||
@@ -1195,9 +1195,7 @@ impl Contact {
|
|||||||
if peerstate.verified_key.is_some() {
|
if peerstate.verified_key.is_some() {
|
||||||
return Ok(VerifiedStatus::BidirectVerified);
|
return Ok(VerifiedStatus::BidirectVerified);
|
||||||
}
|
}
|
||||||
}
|
} else if let Some(peerstate) = Peerstate::from_addr(context, &self.addr).await? {
|
||||||
|
|
||||||
if let Some(peerstate) = Peerstate::from_addr(context, &self.addr).await? {
|
|
||||||
if peerstate.verified_key.is_some() {
|
if peerstate.verified_key.is_some() {
|
||||||
return Ok(VerifiedStatus::BidirectVerified);
|
return Ok(VerifiedStatus::BidirectVerified);
|
||||||
}
|
}
|
||||||
|
|||||||
12
src/qr.rs
12
src/qr.rs
@@ -10,7 +10,7 @@ use percent_encoding::percent_decode_str;
|
|||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
|
|
||||||
use self::dclogin_scheme::configure_from_login_qr;
|
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::config::Config;
|
||||||
use crate::constants::Blocked;
|
use crate::constants::Blocked;
|
||||||
use crate::contact::{
|
use crate::contact::{
|
||||||
@@ -21,7 +21,6 @@ use crate::key::Fingerprint;
|
|||||||
use crate::message::Message;
|
use crate::message::Message;
|
||||||
use crate::peerstate::Peerstate;
|
use crate::peerstate::Peerstate;
|
||||||
use crate::socks::Socks5Config;
|
use crate::socks::Socks5Config;
|
||||||
use crate::tools::time;
|
|
||||||
use crate::{token, EventType};
|
use crate::{token, EventType};
|
||||||
|
|
||||||
const OPENPGP4FPR_SCHEME: &str = "OPENPGP4FPR:"; // yes: uppercase
|
const OPENPGP4FPR_SCHEME: &str = "OPENPGP4FPR:"; // yes: uppercase
|
||||||
@@ -435,16 +434,9 @@ async fn decode_openpgp(context: &Context, qr: &str) -> Result<Qr> {
|
|||||||
Contact::add_or_lookup(context, &name, peerstate_addr, Origin::UnhandledQrScan)
|
Contact::add_or_lookup(context, &name, peerstate_addr, Origin::UnhandledQrScan)
|
||||||
.await
|
.await
|
||||||
.context("add_or_lookup")?;
|
.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
|
.await
|
||||||
.context("Failed to create (new) chat for contact")?;
|
.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 })
|
Ok(Qr::FprOk { contact_id })
|
||||||
} else {
|
} else {
|
||||||
let contact_id = Contact::lookup_id_by_addr(context, &addr, Origin::Unknown)
|
let contact_id = Contact::lookup_id_by_addr(context, &addr, Origin::Unknown)
|
||||||
|
|||||||
Reference in New Issue
Block a user