api: add dc_contact_is_profile_verified()

This commit is contained in:
link2xt
2023-11-07 02:47:59 +00:00
parent 003a27f625
commit 48416289ac
6 changed files with 85 additions and 13 deletions

View File

@@ -24,11 +24,16 @@ pub struct ContactObject {
///
/// If this is true
/// UI should display green checkmark after the contact name
/// in the title of the contact profile,
/// in contact list items and
/// in chat member list items.
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 ID of the contact that verified this contact.
///
/// If this is present,
@@ -52,6 +57,7 @@ impl ContactObject {
None => None,
};
let is_verified = contact.is_verified(context).await? == VerifiedStatus::BidirectVerified;
let is_profile_verified = contact.is_profile_verified(context).await?;
let verifier_id = contact
.get_verifier_id(context)
@@ -70,6 +76,7 @@ impl ContactObject {
name_and_addr: contact.get_name_n_addr(),
is_blocked: contact.is_blocked(),
is_verified,
is_profile_verified,
verifier_id,
last_seen: contact.last_seen(),
was_seen_recently: contact.was_seen_recently(),