mirror of
https://github.com/chatmail/core.git
synced 2026-04-21 15:36:30 +03:00
fix: Handle the case that the user starts a securejoin, and then deletes the contact (#7883)
fix https://github.com/chatmail/core/issues/7880 depends on #7754 (merged) With this change, a securejoin message is just ignored if the contact was deleted in the meantime; apparently the user is not interested in the securejoin process anymore if they deleted the contact. But other, parallel securejoin processes must not be affected; the test also tests this.
This commit is contained in:
@@ -304,7 +304,9 @@ async fn verify_sender_by_fingerprint(
|
||||
fingerprint: &Fingerprint,
|
||||
contact_id: ContactId,
|
||||
) -> Result<bool> {
|
||||
let contact = Contact::get_by_id(context, contact_id).await?;
|
||||
let Some(contact) = Contact::get_by_id_optional(context, contact_id).await? else {
|
||||
return Ok(false);
|
||||
};
|
||||
let is_verified = contact.fingerprint().is_some_and(|fp| &fp == fingerprint);
|
||||
if is_verified {
|
||||
mark_contact_id_as_verified(context, contact_id, Some(ContactId::SELF)).await?;
|
||||
|
||||
Reference in New Issue
Block a user