diff --git a/deltachat-ffi/deltachat.h b/deltachat-ffi/deltachat.h index 3272ea83cf..64feecb18d 100644 --- a/deltachat-ffi/deltachat.h +++ b/deltachat-ffi/deltachat.h @@ -5055,27 +5055,6 @@ int dc_contact_is_verified (dc_contact_t* contact); -/** - * Return the address that verified a contact - * - * The UI may use this in addition to a checkmark showing the verification status. - * In case of verification chains, - * the last contact in the chain is shown. - * This is because of privacy reasons, but also as it would not help the user - * to see a unknown name here - where one can mostly always ask the shown name - * as it is directly known. - * - * @memberof dc_contact_t - * @param contact The contact object. - * @return - * A string containing the verifiers address. If it is the same address as the contact itself, - * we verified the contact ourself. If it is an empty string, we don't have verifier - * information or the contact is not verified. - * @deprecated 2023-09-28, use dc_contact_get_verifier_id instead - */ -char* dc_contact_get_verifier_addr (dc_contact_t* contact); - - /** * Return the contact ID that verified a contact. * diff --git a/deltachat-ffi/src/lib.rs b/deltachat-ffi/src/lib.rs index fe8a9f553a..081e7198a7 100644 --- a/deltachat-ffi/src/lib.rs +++ b/deltachat-ffi/src/lib.rs @@ -4119,23 +4119,6 @@ pub unsafe extern "C" fn dc_contact_is_verified(contact: *mut dc_contact_t) -> l .unwrap_or_default() as libc::c_int } -#[no_mangle] -pub unsafe extern "C" fn dc_contact_get_verifier_addr( - contact: *mut dc_contact_t, -) -> *mut libc::c_char { - if contact.is_null() { - eprintln!("ignoring careless call to dc_contact_get_verifier_addr()"); - return "".strdup(); - } - let ffi_contact = &*contact; - let ctx = &*ffi_contact.context; - block_on(ffi_contact.contact.get_verifier_addr(ctx)) - .context("failed to get verifier for contact") - .log_err(ctx) - .unwrap_or_default() - .strdup() -} - #[no_mangle] pub unsafe extern "C" fn dc_contact_get_verifier_id(contact: *mut dc_contact_t) -> u32 { if contact.is_null() { diff --git a/deltachat-jsonrpc/src/api/types/contact.rs b/deltachat-jsonrpc/src/api/types/contact.rs index 5e6cf6b945..f41f905e7b 100644 --- a/deltachat-jsonrpc/src/api/types/contact.rs +++ b/deltachat-jsonrpc/src/api/types/contact.rs @@ -28,11 +28,6 @@ pub struct ContactObject { /// in contact list items and in chat member list items. is_verified: bool, - /// The address that verified this contact - /// - /// Deprecated, use `verifier_id` instead. - verifier_addr: Option, - /// The ID of the contact that verified this contact. /// /// If this is present, @@ -56,7 +51,6 @@ impl ContactObject { }; let is_verified = contact.is_verified(context).await? == VerifiedStatus::BidirectVerified; - let verifier_addr = contact.get_verifier_addr(context).await?; let verifier_id = contact .get_verifier_id(context) .await? @@ -74,7 +68,6 @@ impl ContactObject { name_and_addr: contact.get_name_n_addr(), is_blocked: contact.is_blocked(), is_verified, - verifier_addr, 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 3c7df7056f..750b7a7627 100644 --- a/src/contact.rs +++ b/src/contact.rs @@ -1279,15 +1279,6 @@ impl Contact { Ok(VerifiedStatus::Unverified) } - /// Returns the address that verified the contact. - /// - /// Deprecated, use [Self::get_verifier_id] instead. - pub async fn get_verifier_addr(&self, context: &Context) -> Result> { - Ok(Peerstate::from_addr(context, self.get_addr()) - .await? - .and_then(|peerstate| peerstate.get_verifier().map(|addr| addr.to_owned()))) - } - /// Returns the `ContactId` that verified the contact. /// /// If the function returns non-zero result, @@ -1301,7 +1292,10 @@ impl Contact { /// Use [Self::is_verified] to check /// if a contact can be added to a verified chat instead. pub async fn get_verifier_id(&self, context: &Context) -> Result> { - let Some(verifier_addr) = self.get_verifier_addr(context).await? else { + let Some(verifier_addr) = Peerstate::from_addr(context, self.get_addr()) + .await? + .and_then(|peerstate| peerstate.get_verifier().map(|addr| addr.to_owned())) + else { return Ok(None); }; @@ -2765,7 +2759,6 @@ Hi."#; let contact_id = Contact::create(&alice, "Bob", "bob@example.net").await?; let contact = Contact::get_by_id(&alice, contact_id).await?; - assert!(contact.get_verifier_addr(&alice).await?.is_none()); assert!(contact.get_verifier_id(&alice).await?.is_none()); // Receive a message from Bob to create a peerstate. @@ -2774,7 +2767,6 @@ Hi."#; alice.recv_msg(&sent_msg).await; let contact = Contact::get_by_id(&alice, contact_id).await?; - assert!(contact.get_verifier_addr(&alice).await?.is_none()); assert!(contact.get_verifier_id(&alice).await?.is_none()); Ok(())