Skip to content

Commit d52fd61

Browse files
committed
fix: Update verifier_id if it's "unknown" and new verifier has known verifier
Now that the previous commit avoids creating incorrect reverse verification chains, we can do this. Sure, existing users' dbs aready have verification chains ending with "unknown" roots, but at least for new users updating `verifier_id` to a known verifier makes sense.
1 parent 19b5126 commit d52fd61

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/contact.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1963,7 +1963,7 @@ pub(crate) async fn mark_contact_id_as_verified(
19631963
verifier_id,
19641964
"Contact cannot be verified by self",
19651965
);
1966-
let update = verifier_id == Some(ContactId::SELF);
1966+
let by_self = verifier_id == Some(ContactId::SELF);
19671967
let mut verifier_id = verifier_id.unwrap_or(contact_id);
19681968
context
19691969
.sql
@@ -2001,8 +2001,8 @@ pub(crate) async fn mark_contact_id_as_verified(
20012001
}
20022002
transaction.execute(
20032003
"UPDATE contacts SET verifier=?1
2004-
WHERE id=?2 AND (verifier=0 OR ?3)",
2005-
(verifier_id, contact_id, update),
2004+
WHERE id=?2 AND (verifier=0 OR verifier=id OR ?3)",
2005+
(verifier_id, contact_id, by_self),
20062006
)?;
20072007
Ok(())
20082008
})

0 commit comments

Comments
 (0)