mirror of
https://github.com/chatmail/core.git
synced 2026-05-02 04:46:29 +03:00
refactor: remove EncryptHelper.prefer_encrypt
It always had the same value of EncryptPreference::Mutual
This commit is contained in:
10
src/e2ee.rs
10
src/e2ee.rs
@@ -12,29 +12,23 @@ use crate::pgp::{self, SeipdVersion};
|
|||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct EncryptHelper {
|
pub struct EncryptHelper {
|
||||||
pub prefer_encrypt: EncryptPreference,
|
|
||||||
pub addr: String,
|
pub addr: String,
|
||||||
pub public_key: SignedPublicKey,
|
pub public_key: SignedPublicKey,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl EncryptHelper {
|
impl EncryptHelper {
|
||||||
pub async fn new(context: &Context) -> Result<EncryptHelper> {
|
pub async fn new(context: &Context) -> Result<EncryptHelper> {
|
||||||
let prefer_encrypt = EncryptPreference::Mutual;
|
|
||||||
let addr = context.get_primary_self_addr().await?;
|
let addr = context.get_primary_self_addr().await?;
|
||||||
let public_key = load_self_public_key(context).await?;
|
let public_key = load_self_public_key(context).await?;
|
||||||
|
|
||||||
Ok(EncryptHelper {
|
Ok(EncryptHelper { addr, public_key })
|
||||||
prefer_encrypt,
|
|
||||||
addr,
|
|
||||||
public_key,
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_aheader(&self) -> Aheader {
|
pub fn get_aheader(&self) -> Aheader {
|
||||||
Aheader {
|
Aheader {
|
||||||
addr: self.addr.clone(),
|
addr: self.addr.clone(),
|
||||||
public_key: self.public_key.clone(),
|
public_key: self.public_key.clone(),
|
||||||
prefer_encrypt: self.prefer_encrypt,
|
prefer_encrypt: EncryptPreference::Mutual,
|
||||||
verified: false,
|
verified: false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user