docs: clarify the meaning of is_verified() vs verifier_id() (#7027)

this PR adapts the documentation UI guidance to recent "green checkmark"
discussions

cmp https://github.com/deltachat/deltachat-pages/pull/1145,
https://github.com/deltachat/deltachat-ios/pull/2781,
https://github.com/deltachat/deltachat-android/pull/3828,
https://github.com/deltachat/deltachat-desktop/pull/5318

---------

Co-authored-by: Hocuri <hocuri@gmx.de>
This commit is contained in:
bjoern
2025-07-22 10:40:12 +02:00
committed by GitHub
parent edd8008650
commit dbad714539
4 changed files with 53 additions and 45 deletions

View File

@@ -3818,12 +3818,6 @@ int dc_chat_can_send (const dc_chat_t* chat);
* Protected chats are created using dc_create_group_chat() * Protected chats are created using dc_create_group_chat()
* by setting the 'protect' parameter to 1. * by setting the 'protect' parameter to 1.
* *
* UI should display a green checkmark
* in the chat title,
* in the chatlist item
* and in the chat profile
* if chat protection is enabled.
*
* @memberof dc_chat_t * @memberof dc_chat_t
* @param chat The chat object. * @param chat The chat object.
* @return 1=chat protected, 0=chat is not protected. * @return 1=chat protected, 0=chat is not protected.
@@ -5259,20 +5253,14 @@ int dc_contact_is_blocked (const dc_contact_t* contact);
/** /**
* Check if the contact * Check if the contact
* can be added to verified chats, * can be added to protected chats.
* i.e. has a verified key
* and Autocrypt key matches the verified key.
* *
* If contact is verified * See dc_contact_get_verifier_id() for a guidance how to display these information.
* UI should display green checkmark after the contact name
* in contact list items,
* in chat member list items
* and in profiles if no chat with the contact exist (otherwise, use dc_chat_is_protected()).
* *
* @memberof dc_contact_t * @memberof dc_contact_t
* @param contact The contact object. * @param contact The contact object.
* @return 0: contact is not verified. * @return 0: contact is not verified.
* 2: SELF and contact have verified their fingerprints in both directions; in the UI typically checkmarks are shown. * 2: SELF and contact have verified their fingerprints in both directions.
*/ */
int dc_contact_is_verified (dc_contact_t* contact); int dc_contact_is_verified (dc_contact_t* contact);
@@ -5303,16 +5291,22 @@ int dc_contact_is_key_contact (dc_contact_t* contact);
/** /**
* Return the contact ID that verified a contact. * Return the contact ID that verified a contact.
* *
* If the function returns non-zero result, * As verifier may be unknown,
* display green checkmark in the profile and "Introduced by ..." line * use dc_contact_is_verified() to check if a contact can be added to a protected chat.
* with the name and address of the contact
* formatted by dc_contact_get_name_n_addr.
* *
* If this function returns a verifier, * UI should display the information in the contact's profile as follows:
* this does not necessarily mean *
* you can add the contact to verified chats. * - If dc_contact_get_verifier_id() != 0,
* Use dc_contact_is_verified() to check * display text "Introduced by ..."
* if a contact can be added to a verified chat instead. * with the name and address of the contact
* formatted by dc_contact_get_name_n_addr().
* Prefix the text by a green checkmark.
*
* - If dc_contact_get_verifier_id() == 0 and dc_contact_is_verified() != 0,
* display "Introduced" prefixed by a green checkmark.
*
* - if dc_contact_get_verifier_id() == 0 and dc_contact_is_verified() == 0,
* display nothing
* *
* @memberof dc_contact_t * @memberof dc_contact_t
* @param contact The contact object. * @param contact The contact object.
@@ -6378,7 +6372,6 @@ void dc_event_unref(dc_event_t* event);
/** /**
* Chat changed. The name or the image of a chat group was changed or members were added or removed. * Chat changed. The name or the image of a chat group was changed or members were added or removed.
* Or the verify state of a chat has changed.
* See dc_set_chat_name(), dc_set_chat_profile_image(), dc_add_contact_to_chat() * See dc_set_chat_name(), dc_set_chat_profile_image(), dc_add_contact_to_chat()
* and dc_remove_contact_from_chat(). * and dc_remove_contact_from_chat().
* *

View File

@@ -21,15 +21,16 @@ pub struct FullChat {
/// True if the chat is protected. /// True if the chat is protected.
/// ///
/// UI should display a green checkmark /// Only verified contacts
/// in the chat title, /// as determined by [`ContactObject::is_verified`] / `Contact.isVerified`
/// in the chat profile title and /// can be added to protected chats.
/// in the chatlist item ///
/// if chat protection is enabled. /// Protected chats are created using [`create_group_chat`] / `createGroupChat()`
/// UI should also display a green checkmark /// by setting the 'protect' parameter to true.
/// in the contact profile ///
/// if 1:1 chat with this contact exists and is protected. /// [`create_group_chat`]: crate::api::CommandApi::create_group_chat
is_protected: bool, is_protected: bool,
/// True if the chat is encrypted. /// True if the chat is encrypted.
/// This means that all messages in the chat are encrypted, /// This means that all messages in the chat are encrypted,
/// and all contacts in the chat are "key-contacts", /// and all contacts in the chat are "key-contacts",

View File

@@ -31,13 +31,11 @@ pub struct ContactObject {
/// e.g. if we just scanned the fingerprint from a QR code. /// e.g. if we just scanned the fingerprint from a QR code.
e2ee_avail: bool, e2ee_avail: bool,
/// True if the contact can be added to verified groups. /// True if the contact
/// can be added to protected chats
/// because SELF and contact have verified their fingerprints in both directions.
/// ///
/// If this is true /// See [`Self::verifier_id`]/`Contact.verifierId` for a guidance how to display these information.
/// UI should display green checkmark after the contact name
/// in contact list items,
/// in chat member list items
/// and in profiles if no chat with the contact exist.
is_verified: bool, is_verified: bool,
/// True if the contact profile title should have a green checkmark. /// True if the contact profile title should have a green checkmark.
@@ -46,12 +44,29 @@ pub struct ContactObject {
/// or will have a green checkmark if created. /// or will have a green checkmark if created.
is_profile_verified: bool, is_profile_verified: bool,
/// The ID of the contact that verified this contact. /// The contact ID that verified a contact.
/// ///
/// If this is present, /// As verifier may be unknown,
/// display a green checkmark and "Introduced by ..." /// use [`Self::is_verified`]/`Contact.isVerified` to check if a contact can be added to a protected chat.
/// string followed by the verifier contact name and address ///
/// in the contact profile. /// UI should display the information in the contact's profile as follows:
///
/// - If `verifierId` != 0,
/// display text "Introduced by ..."
/// with the name and address of the contact
/// formatted by `name_and_addr`/`nameAndAddr`.
/// Prefix the text by a green checkmark.
///
/// - If `verifierId` == 0 and `isVerified` != 0,
/// display "Introduced" prefixed by a green checkmark.
///
/// - if `verifierId` == 0 and `isVerified` == 0,
/// display nothing
///
/// This contains the contact ID of the verifier.
/// If it is `DC_CONTACT_ID_SELF`, we verified the contact ourself.
/// If it is None/Null, we don't have verifier information or
/// the contact is not verified.
verifier_id: Option<u32>, verifier_id: Option<u32>,
/// the contact's last seen timestamp /// the contact's last seen timestamp

View File

@@ -224,7 +224,6 @@ pub enum EventType {
}, },
/// Chat changed. The name or the image of a chat group was changed or members were added or removed. /// Chat changed. The name or the image of a chat group was changed or members were added or removed.
/// Or the verify state of a chat has changed.
/// See setChatName(), setChatProfileImage(), addContactToChat() /// See setChatName(), setChatProfileImage(), addContactToChat()
/// and removeContactFromChat(). /// and removeContactFromChat().
/// ///