fix: do not reverify already verified contacts via gossip

If the contact is already introduced by someone,
usually by adding to a verified group,
it should not be reverified because of another
chat message is a verified group.
This usually results is verification loops
and is not meaningful because the verifier
likely got this same contact introduced
in the same group.
This commit is contained in:
link2xt
2025-08-14 13:28:09 +00:00
committed by l
parent a955cb5400
commit 7e4822c8ca
2 changed files with 70 additions and 2 deletions

View File

@@ -1977,8 +1977,9 @@ pub(crate) async fn mark_contact_id_as_verified(
}
}
transaction.execute(
"UPDATE contacts SET verifier=? WHERE id=?",
(verifier_id, contact_id),
"UPDATE contacts SET verifier=?1
WHERE id=?2 AND (verifier=0 OR ?1=?3)",
(verifier_id, contact_id, ContactId::SELF),
)?;
Ok(())
})