fix: Don't create 1:1 chat as protected for contact who doesn't prefer to encrypt (#4538)

This commit is contained in:
Hocuri
2023-07-11 19:39:59 +02:00
committed by GitHub
parent 17f2d33731
commit 1e28ea9bb0
2 changed files with 40 additions and 1 deletions

View File

@@ -1999,7 +1999,9 @@ impl ChatIdBlocked {
}
let peerstate = Peerstate::from_addr(context, contact.get_addr()).await?;
let protected = peerstate.map_or(false, |p| p.is_using_verified_key());
let protected = peerstate.map_or(false, |p| {
p.is_using_verified_key() && p.prefer_encrypt == EncryptPreference::Mutual
});
let smeared_time = create_smeared_timestamp(context);
let chat_id = context