Delta Chat Core C-API
|
An object representing a single chat in memory. More...
#include <mrchat.h>
Public Member Functions | |
void | mrchat_unref (mrchat_t *chat) |
Free a chat object. More... | |
void | mrchat_empty (mrchat_t *chat) |
Empty a chat object. More... | |
char * | mrchat_get_subtitle (mrchat_t *chat) |
Get a subtitle for a chat. More... | |
Public Attributes | |
uint32_t | m_id |
Chat ID under which the chat is filed in the database. More... | |
int | m_type |
Chat type. More... | |
char * | m_name |
Name of the chat. More... | |
time_t | m_draft_timestamp |
Timestamp of the draft. More... | |
char * | m_draft_text |
The draft text. More... | |
mrmailbox_t * | m_mailbox |
The mailbox object the chat belongs to. More... | |
int | m_archived |
Flag for the archived state. More... | |
mrparam_t * | m_param |
Additional parameters for the chat. More... | |
An object representing a single chat in memory.
Chat objects are created using eg. mrmailbox_get_chat() and are not updated on database changes; if you want an update, you have to recreate the object.
void mrchat_empty | ( | mrchat_t * | chat | ) |
Empty a chat object.
chat | The chat object to empty. |
char * mrchat_get_subtitle | ( | mrchat_t * | chat | ) |
Get a subtitle for a chat.
The sibtitle is eg. the email-address or the number of group members.
chat | The chat object to calulate the subtitle for. |
void mrchat_unref | ( | mrchat_t * | chat | ) |
Free a chat object.
chat | Chat object are returned eg. by mrmailbox_get_chat() or mrchat_new(). |
int mrchat_t::m_archived |
Flag for the archived state.
0=normal chat, not archived, not sticky.
1=chat archived
2=chat sticky (reserved for future use, if you do not support this value, just treat the chat as a normal one)
To archive or unarchive chats, use mrmailbox_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.
char* mrchat_t::m_draft_text |
The draft text.
The timetamp of the draft is placed in mrchat_t::m_draft_timestamp. To save a draft for a chat, use mrmailbox_set_draft()
NULL if there is no draft.
time_t mrchat_t::m_draft_timestamp |
Timestamp of the draft.
The draft itself is placed in mrchat_t::m_draft_text. To save a draft for a chat, use mrmailbox_set_draft()
0 if there is no draft.
uint32_t mrchat_t::m_id |
Chat ID under which the chat is filed in the database.
Special IDs:
"Normal" chat IDs are larger than these special IDs (larger than MR_CHAT_ID_LAST_SPECIAL).
mrmailbox_t* mrchat_t::m_mailbox |
The mailbox object the chat belongs to.
Never NULL.
char* mrchat_t::m_name |
Name of the chat.
For one-to-one chats, this is the name of the contact. For group chats, this is the name given eg. to mrmailbox_create_group_chat() or received by a group-creation message.
To change the name, use mrmailbox_set_chat_name()
NULL if unset.
mrparam_t* mrchat_t::m_param |
Additional parameters for the chat.
To access the parameters, use mrparam_exists(), mrparam_get() for mrparam_get_int()
int mrchat_t::m_type |
Chat type.
If the chat type is not set, it is MR_CHAT_TYPE_UNDEFINED (0).