![]() |
Delta Chat Core C-API
|
#include <deltachat.h>
Public Member Functions | |
int | dc_chat_get_archived (const dc_chat_t *chat) |
Get archived state. More... | |
uint32_t | dc_chat_get_color (const dc_chat_t *chat) |
Get a color for the chat. More... | |
uint32_t | dc_chat_get_id (const dc_chat_t *chat) |
Get chat ID. More... | |
char * | dc_chat_get_name (const dc_chat_t *chat) |
Get name of a chat. More... | |
char * | dc_chat_get_profile_image (const dc_chat_t *chat) |
Get the chat's profile image. More... | |
char * | dc_chat_get_subtitle (const dc_chat_t *chat) |
Get a subtitle for a chat. More... | |
int | dc_chat_get_type (const dc_chat_t *chat) |
Get chat type. More... | |
int | dc_chat_is_self_talk (const dc_chat_t *chat) |
Check if a chat is a self talk. More... | |
int | dc_chat_is_sending_locations (const dc_chat_t *chat) |
Check if locations are sent to the chat at the time the object was created using dc_get_chat(). More... | |
int | dc_chat_is_unpromoted (const dc_chat_t *chat) |
Check if a group chat is still unpromoted. More... | |
int | dc_chat_is_verified (const dc_chat_t *chat) |
Check if a chat is verified. More... | |
void | dc_chat_unref (dc_chat_t *chat) |
Free a chat object. More... | |
An object representing a single chat in memory. Chat objects are created using eg. dc_get_chat() and are not updated on database changes; if you want an update, you have to recreate the object.
int dc_chat_get_archived | ( | const dc_chat_t * | chat | ) |
Get archived state.
To archive or unarchive chats, use dc_archive_chat(). If chats are archived, this should be shown in the UI by a little icon or text, eg. the search will also return archived chats.
chat | The chat object. |
uint32_t dc_chat_get_color | ( | const dc_chat_t * | chat | ) |
Get a color for the chat.
For 1:1 chats, the color is calculated from the contact's email address. Otherwise, the chat name is used. The color can be used for an fallback avatar with white initials as well as for headlines in bubbles of group chats.
chat | The chat object. |
uint32_t dc_chat_get_id | ( | const dc_chat_t * | chat | ) |
Get chat ID.
The chat ID is the ID under which the chat is filed in the database.
Special IDs:
"Normal" chat IDs are larger than these special IDs (larger than DC_CHAT_ID_LAST_SPECIAL).
chat | The chat object. |
char * dc_chat_get_name | ( | const dc_chat_t * | chat | ) |
Get name of a chat.
For one-to-one chats, this is the name of the contact. For group chats, this is the name given eg. to dc_create_group_chat() or received by a group-creation message.
To change the name, use dc_set_chat_name()
See also: dc_chat_get_subtitle()
chat | The chat object. |
char * dc_chat_get_profile_image | ( | const dc_chat_t * | chat | ) |
Get the chat's profile image.
For groups, this is the image set by any group member using dc_set_chat_profile_image(). For normal chats, this is the image set by each remote user on their own using dc_set_config(context, "selfavatar", image).
chat | The chat object. |
char * dc_chat_get_subtitle | ( | const dc_chat_t * | chat | ) |
Get a subtitle for a chat.
The subtitle is eg. the email-address or the number of group members.
See also: dc_chat_get_name()
chat | The chat object to calulate the subtitle for. |
int dc_chat_get_type | ( | const dc_chat_t * | chat | ) |
Get chat type.
Currently, there are two chat types:
chat | The chat object. |
int dc_chat_is_self_talk | ( | const dc_chat_t * | chat | ) |
Check if a chat is a self talk.
Self talks are normal chats with the only contact DC_CONTACT_ID_SELF.
chat | The chat object. |
int dc_chat_is_sending_locations | ( | const dc_chat_t * | chat | ) |
Check if locations are sent to the chat at the time the object was created using dc_get_chat().
To check if locations are sent to any chat, use dc_is_sending_locations_to_chat().
chat | The chat object. |
int dc_chat_is_unpromoted | ( | const dc_chat_t * | chat | ) |
Check if a group chat is still unpromoted.
After the creation with dc_create_group_chat() the chat is usually unpromoted until the first call to dc_send_text_msg() or another sending function.
With unpromoted chats, members can be added and settings can be modified without the need of special status messages being sent.
While the core takes care of the unpromoted state on its own, checking the state from the UI side may be useful to decide whether a hint as "Send the first message to allow others to reply within the group" should be shown to the user or not.
chat | The chat object. |
int dc_chat_is_verified | ( | const dc_chat_t * | chat | ) |
Check if a chat is verified.
Verified chats contain only verified members and encryption is alwasy enabled. Verified chats are created using dc_create_group_chat() by setting the 'verified' parameter to true.
chat | The chat object. |
void dc_chat_unref | ( | dc_chat_t * | chat | ) |
Free a chat object.
chat | Chat object are returned eg. by dc_get_chat(). If NULL is given, nothing is done. |