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... | |
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... | |
char * | mrcontact_get_first_name (const char *full_name) |
Get the first name. More... | |
void | mrcontact_normalize_name (char *full_name) |
Normalize a name in-place. More... | |
Public Attributes | |
uint32_t | m_id |
The contact ID. More... | |
char * | m_name |
Contact name. More... | |
char * | m_authname |
Name authorized by the contact himself. More... | |
char * | m_addr |
E-Mail-Address of the contact. More... | |
int | m_blocked |
Blocked state. 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(). |
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 |
char * mrcontact_get_first_name | ( | const char * | full_name | ) |
Get the first name.
In a string, get the part before the first space. If there is no space in the string, the whole string is returned.
full_name | Full name of the contct. |
void mrcontact_normalize_name | ( | char * | full_name | ) |
Normalize a name in-place.
Typically, this function is not needed as it is called implicitly by mrmailbox_add_address_book()
full_name | Buffer with the name, is modified during processing; the resulting string may be shorter but never longer. |
uint32_t mrcontact_t::m_id |
The contact ID.
Special message IDs:
Normal contact IDs are larger than these special ones (larger than MR_CONTACT_ID_LAST_SPECIAL).
char* mrcontact_t::m_name |
Contact name.
It is recommended to use mrcontact_get_name(), mrcontact_get_display_name() or mrcontact_get_name_n_addr() to access this field. May be NULL or empty, initially set to m_authname.
char* mrcontact_t::m_authname |
Name authorized by the contact himself.
It is recommended to use mrcontact_get_name(), mrcontact_get_display_name() or mrcontact_get_name_n_addr() to access this field. This is the name authorized by the sender, only this name may be speaded to others, eg. in To:-lists. May be NULL or empty.
char* mrcontact_t::m_addr |
E-Mail-Address of the contact.
It is recommended to use mrcontact_get_addr() to access this field. May be NULL.
int mrcontact_t::m_blocked |
Blocked state.
1=contact is blocked, 0=contact is not blocked. To block or unblock a contact, use mrmailbox_block_contact().