Delta Chat Core C-API
|
An object representing a single contact in memory. More...
#include <mrcontact.h>
Public Member Functions | |
void | mrcontact_unref (mrcontact_t *contact) |
Free a contact object. More... | |
uint32_t | mrcontact_get_id (mrcontact_t *contact) |
Get the ID of the contact. More... | |
char * | mrcontact_get_addr (mrcontact_t *contact) |
Get email address. More... | |
char * | mrcontact_get_name (mrcontact_t *contact) |
Get name. More... | |
char * | mrcontact_get_display_name (mrcontact_t *contact) |
Get display name. More... | |
char * | mrcontact_get_name_n_addr (mrcontact_t *contact) |
Get a summary of name and address. More... | |
int | mrcontact_is_blocked (mrcontact_t *contact) |
Check if a contact is blocked. More... | |
An object representing a single contact in memory.
The contact object is not updated. If you want an update, you have to recreate the object.
void mrcontact_unref | ( | mrcontact_t * | contact | ) |
Free a contact object.
contact | The contact object as created eg. by mrmailbox_get_contact(). |
uint32_t mrcontact_get_id | ( | mrcontact_t * | contact | ) |
Get the ID of the contact.
contact | The contact object. |
char * mrcontact_get_addr | ( | mrcontact_t * | contact | ) |
Get email address.
The email address is always set for a contact.
contact | The contact object. |
char * mrcontact_get_name | ( | mrcontact_t * | contact | ) |
Get name.
This is the name as defined the the contact himself or modified by the user. May be an empty string.
This name is typically used in a form where the user can edit the name of a contact. This name must not be spreaded via mail (To:, CC: ...) as it as it may be sth. like "Daddy". To get a fine name to display in lists etc., use mrcontact_get_display_name() or mrcontact_get_name_n_addr().
contact | The contact object. |
char * mrcontact_get_display_name | ( | mrcontact_t * | contact | ) |
Get display name.
This is the name as defined the the contact himself, modified by the user or, if both are unset, the email address.
This name is typically used in lists and must not be speaded via mail (To:, CC: ...). To get the name editable in a formular, use mrcontact_get_edit_name().
contact | The contact object. |
char * mrcontact_get_name_n_addr | ( | mrcontact_t * | contact | ) |
Get a summary of name and address.
The returned string is either "Name (email@domain.com)" or just "email@domain.com" if the name is unset.
The summary is typically used when asking the user something about the contact. The attached email address makes the question unique, eg. "Chat with Alan Miller (am@uniquedomain.com)?"
The summary must not be spreaded via mail (To:, CC: ...) as it as it may contain sth. like "Daddy".
contact | The contact object. |
int mrcontact_is_blocked | ( | mrcontact_t * | contact | ) |
Check if a contact is blocked.
To block or unblock a contact, use mrmailbox_block_contact().
contact | The contact object. |