diff --git a/deltachat-jsonrpc/src/api/types/contact.rs b/deltachat-jsonrpc/src/api/types/contact.rs index c4fb5663e..9a98a75f9 100644 --- a/deltachat-jsonrpc/src/api/types/contact.rs +++ b/deltachat-jsonrpc/src/api/types/contact.rs @@ -38,12 +38,6 @@ pub struct ContactObject { /// See [`Self::verifier_id`]/`Contact.verifierId` for a guidance how to display these information. is_verified: bool, - /// True if the contact profile title should have a green checkmark. - /// - /// This indicates whether 1:1 chat has a green checkmark - /// or will have a green checkmark if created. - is_profile_verified: bool, - /// The contact ID that verified a contact. /// /// As verifier may be unknown, @@ -87,7 +81,6 @@ impl ContactObject { None => None, }; let is_verified = contact.is_verified(context).await?; - let is_profile_verified = contact.is_profile_verified(context).await?; let verifier_id = contact .get_verifier_id(context) @@ -109,7 +102,6 @@ impl ContactObject { is_key_contact: contact.is_key_contact(), e2ee_avail: contact.e2ee_avail(context).await?, is_verified, - is_profile_verified, verifier_id, last_seen: contact.last_seen(), was_seen_recently: contact.was_seen_recently(), diff --git a/src/contact.rs b/src/contact.rs index a9925a04f..84750a00d 100644 --- a/src/contact.rs +++ b/src/contact.rs @@ -21,7 +21,7 @@ use tokio::task; use tokio::time::{Duration, timeout}; use crate::blob::BlobObject; -use crate::chat::{ChatId, ChatIdBlocked, ProtectionStatus}; +use crate::chat::ChatId; use crate::color::str_to_color; use crate::config::Config; use crate::constants::{self, Blocked, Chattype}; @@ -1650,29 +1650,6 @@ impl Contact { } } - /// Returns if the contact profile title should display a green checkmark. - /// - /// This generally should be consistent with the 1:1 chat with the contact - /// so 1:1 chat with the contact and the contact profile - /// either both display the green checkmark or both don't display a green checkmark. - /// - /// UI often knows beforehand if a chat exists and can also call - /// `chat.is_protected()` (if there is a chat) - /// or `contact.is_verified()` (if there is no chat) directly. - /// This is often easier and also skips some database calls. - pub async fn is_profile_verified(&self, context: &Context) -> Result { - let contact_id = self.id; - - if let Some(ChatIdBlocked { id: chat_id, .. }) = - ChatIdBlocked::lookup_by_contact(context, contact_id).await? - { - Ok(chat_id.is_protected(context).await? == ProtectionStatus::Protected) - } else { - // 1:1 chat does not exist. - Ok(self.is_verified(context).await?) - } - } - /// Returns the number of real (i.e. non-special) contacts in the database. pub async fn get_real_cnt(context: &Context) -> Result { if !context.sql.is_open().await { diff --git a/src/contact/contact_tests.rs b/src/contact/contact_tests.rs index 48f2f2af4..646956539 100644 --- a/src/contact/contact_tests.rs +++ b/src/contact/contact_tests.rs @@ -1,7 +1,7 @@ use deltachat_contact_tools::{addr_cmp, may_be_valid_addr}; use super::*; -use crate::chat::{Chat, get_chat_contacts, send_text_msg}; +use crate::chat::{Chat, ProtectionStatus, get_chat_contacts, send_text_msg}; use crate::chatlist::Chatlist; use crate::receive_imf::receive_imf; use crate::test_utils::{self, TestContext, TestContextManager, TimeShiftFalsePositiveNote}; @@ -1302,7 +1302,6 @@ async fn test_self_is_verified() -> Result<()> { let contact = Contact::get_by_id(&alice, ContactId::SELF).await?; assert_eq!(contact.is_verified(&alice).await?, true); - assert!(contact.is_profile_verified(&alice).await?); assert!(contact.get_verifier_id(&alice).await?.is_none()); assert!(contact.is_key_contact());