From caffc3d93c5ffc165fe12baa4b703c0917951354 Mon Sep 17 00:00:00 2001 From: link2xt Date: Fri, 3 Nov 2023 02:47:32 +0000 Subject: [PATCH] fix(json-rpc): return verifier even if the contact is not verified This may happen if autocrypt key is changed after verification. UI should still display who introduced the contact, especially if the contact is still a member of some verified group. If the contact is at the same time not verified, i.e. its autocrypt key does not match verified key, UI may display a crossed out checkmark instead of green checkmark. --- deltachat-jsonrpc/src/api/types/contact.rs | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/deltachat-jsonrpc/src/api/types/contact.rs b/deltachat-jsonrpc/src/api/types/contact.rs index 53b0ef67c..16c1a3917 100644 --- a/deltachat-jsonrpc/src/api/types/contact.rs +++ b/deltachat-jsonrpc/src/api/types/contact.rs @@ -40,17 +40,11 @@ impl ContactObject { }; let is_verified = contact.is_verified(context).await? == VerifiedStatus::BidirectVerified; - let (verifier_addr, verifier_id) = if is_verified { - ( - contact.get_verifier_addr(context).await?, - contact - .get_verifier_id(context) - .await? - .map(|contact_id| contact_id.to_u32()), - ) - } else { - (None, None) - }; + let verifier_addr = contact.get_verifier_addr(context).await?; + let verifier_id = contact + .get_verifier_id(context) + .await? + .map(|contact_id| contact_id.to_u32()); Ok(ContactObject { address: contact.get_addr().to_owned(),