mirror of
https://github.com/chatmail/core.git
synced 2026-04-27 18:36:30 +03:00
Split off functional contact tools into its own crate (#5444)
I would like to implement https://github.com/deltachat/deltachat-core-rust/issues/5422 in its own crate, but it will depend on some functions that are in the `deltachat` crate. So, this PR extracts these functions into its own crate so that I can add https://github.com/deltachat/deltachat-core-rust/issues/5422 into the new crate.
This commit is contained in:
@@ -1,13 +1,15 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use anyhow::{bail, Context as _, Result};
|
||||
|
||||
use deltachat_contact_tools::may_be_valid_addr;
|
||||
use num_traits::cast::ToPrimitive;
|
||||
|
||||
use super::{Qr, DCLOGIN_SCHEME};
|
||||
use crate::config::Config;
|
||||
use crate::context::Context;
|
||||
use crate::login_param::CertificateChecks;
|
||||
use crate::provider::Socket;
|
||||
use crate::{contact, login_param::CertificateChecks};
|
||||
|
||||
/// Options for `dclogin:` scheme.
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
@@ -88,7 +90,7 @@ pub(super) fn decode_login(qr: &str) -> Result<Qr> {
|
||||
.collect();
|
||||
|
||||
// check if username is there
|
||||
if !contact::may_be_valid_addr(addr) {
|
||||
if !may_be_valid_addr(addr) {
|
||||
bail!("invalid DCLOGIN payload: invalid username E5");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user