feat: mark saved messages chat as protected

This commit is contained in:
link2xt
2023-11-10 21:24:07 +00:00
committed by l
parent 170b7e2ded
commit 9ec1401a37
2 changed files with 22 additions and 4 deletions

View File

@@ -2593,10 +2593,12 @@ impl ChatIdBlocked {
_ => (),
}
let peerstate = Peerstate::from_addr(context, contact.get_addr()).await?;
let protected = peerstate.map_or(false, |p| {
p.is_using_verified_key() && p.prefer_encrypt == EncryptPreference::Mutual
});
let protected = contact_id == ContactId::SELF || {
let peerstate = Peerstate::from_addr(context, contact.get_addr()).await?;
peerstate.is_some_and(|p| {
p.is_using_verified_key() && p.prefer_encrypt == EncryptPreference::Mutual
})
};
let smeared_time = create_smeared_timestamp(context);
let chat_id = context