fix: Don't reverify contacts by SELF on receipt of a message from another device

Also verify not yet verified contacts w/o setting a verifier for them (in the db it's stored as
`verifier_id=id` though) because we don't know who verified them for another device.
This commit is contained in:
iequidoo
2025-08-28 04:18:26 -03:00
committed by iequidoo
parent 9f1107c0e7
commit 61633cf23b
6 changed files with 41 additions and 9 deletions

View File

@@ -210,7 +210,7 @@ async fn verify_sender_by_fingerprint(
let contact = Contact::get_by_id(context, contact_id).await?;
let is_verified = contact.fingerprint().is_some_and(|fp| &fp == fingerprint);
if is_verified {
mark_contact_id_as_verified(context, contact_id, ContactId::SELF).await?;
mark_contact_id_as_verified(context, contact_id, Some(ContactId::SELF)).await?;
}
Ok(is_verified)
}
@@ -548,7 +548,7 @@ pub(crate) async fn observe_securejoin_on_other_device(
return Ok(HandshakeMessage::Ignore);
}
mark_contact_id_as_verified(context, contact_id, ContactId::SELF).await?;
mark_contact_id_as_verified(context, contact_id, Some(ContactId::SELF)).await?;
ChatId::set_protection_for_contact(context, contact_id, mime_message.timestamp_sent).await?;