Delta Chat Core C-API
|
The following constants are used as events reported to the callback given to mrmailbox_new(). More...
Go to the source code of this file.
Macros | |
#define | MR_EVENT_INFO 100 |
The user may write an informational string to the log. More... | |
#define | MR_EVENT_WARNING 300 |
The user should write an warning string to the log. More... | |
#define | MR_EVENT_ERROR 400 |
The user should show an error. More... | |
#define | MR_EVENT_MSGS_CHANGED 2000 |
Messages or chats changed. More... | |
#define | MR_EVENT_INCOMING_MSG 2005 |
There is a fresh message. More... | |
#define | MR_EVENT_MSG_DELIVERED 2010 |
A single message is send successfully (state changed from MR_STATE_OUT_PENDING to MR_STATE_OUT_DELIVERED, see mrmsg_t::m_state). More... | |
#define | MR_EVENT_MSG_READ 2015 |
A single message is read by the receiver (state changed from MR_STATE_OUT_DELIVERED to MR_STATE_OUT_MDN_RCVD, see mrmsg_t::m_state). More... | |
#define | MR_EVENT_CHAT_MODIFIED 2020 |
Group changed. More... | |
#define | MR_EVENT_CONTACTS_CHANGED 2030 |
Contact(s) created, renamed, blocked or deleted. More... | |
#define | MR_EVENT_CONFIGURE_PROGRESS 2041 |
Inform about the configuration progress started by mrmailbox_configure_and_connect(). More... | |
#define | MR_EVENT_IMEX_PROGRESS 2051 |
Inform about the import/export progress started by mrmailbox_imex(). More... | |
#define | MR_EVENT_IMEX_FILE_WRITTEN 2052 |
A file has been exported. More... | |
#define | MR_EVENT_IS_OFFLINE 2081 |
Ask the frontend about the offline state. More... | |
#define | MR_EVENT_GET_STRING 2091 |
Requeste a localized string from the frontend. More... | |
#define | MR_EVENT_GET_QUANTITY_STRING 2092 |
Requeste a localized quantitiy string from the frontend. More... | |
#define | MR_EVENT_HTTP_GET 2100 |
Request a HTTP-file from the frontend. More... | |
#define | MR_EVENT_WAKE_LOCK 2110 |
Acquire or release a wakelock. More... | |
The following constants are used as events reported to the callback given to mrmailbox_new().
If you do not want to handle an event, it is always safe to return 0, so there is no need to add a "case" for every event.
#define MR_EVENT_INFO 100 |
The user may write an informational string to the log.
Passed to the callback given to mrmailbox_new(). This event should not be reported using a popup or something like that.
data1 | 0 |
data2 | Info string |
#define MR_EVENT_WARNING 300 |
The user should write an warning string to the log.
Passed to the callback given to mrmailbox_new(). This event should not be reported using a popup or something like that.
data1 | 0 |
data2 | Warning string |
#define MR_EVENT_ERROR 400 |
The user should show an error.
The error must be reported to the user by a non-disturbing bubble or so.
data1 | 0 |
data2 | Error string |
#define MR_EVENT_MSGS_CHANGED 2000 |
Messages or chats changed.
One or more messages or chats changed for various reasons in the database:
data1 | chat_id for single added messages |
data2 | msg_id for single added messages |
#define MR_EVENT_INCOMING_MSG 2005 |
There is a fresh message.
Typically, the user will show an notification when receiving this message.
There is no extra MR_EVENT_MSGS_CHANGED event send together with this event.
data1 | chat_id |
data2 | msg_id |
#define MR_EVENT_MSG_DELIVERED 2010 |
A single message is send successfully (state changed from MR_STATE_OUT_PENDING to MR_STATE_OUT_DELIVERED, see mrmsg_t::m_state).
data1 | chat_id |
data2 | msg_id |
#define MR_EVENT_MSG_READ 2015 |
A single message is read by the receiver (state changed from MR_STATE_OUT_DELIVERED to MR_STATE_OUT_MDN_RCVD, see mrmsg_t::m_state).
data1 | chat_id |
data2 | msg_id |
#define MR_EVENT_CHAT_MODIFIED 2020 |
Group changed.
The name or the image of a chat group was changed or members were added or removed. See mrmailbox_set_chat_name(), mrmailbox_set_chat_profile_image(), mrmailbox_add_contact_to_chat() and mrmailbox_remove_contact_from_chat().
data1 | chat_id |
data2 | 0 |
#define MR_EVENT_CONTACTS_CHANGED 2030 |
Contact(s) created, renamed, blocked or deleted.
data1 | 0 |
data2 | 0 |
#define MR_EVENT_CONFIGURE_PROGRESS 2041 |
Inform about the configuration progress started by mrmailbox_configure_and_connect().
data1 | Permille |
data2 | 0 |
#define MR_EVENT_IMEX_PROGRESS 2051 |
Inform about the import/export progress started by mrmailbox_imex().
data1 | Permille |
data2 | 0 |
#define MR_EVENT_IMEX_FILE_WRITTEN 2052 |
A file has been exported.
A file has been written by mrmailbox_imex(). This event may be send multiple times by a single call to mrmailbox_imex().
A typical purpose for a handler of this event may be to make the file public to some system services.
data1 | File name |
data2 | 0 |
#define MR_EVENT_IS_OFFLINE 2081 |
Ask the frontend about the offline state.
This function may be provided by the frontend. If we already know, that we're offline, eg. there is no need to try to connect and things will speed up.
data1 | 0 |
data2 | 0 |
#define MR_EVENT_GET_STRING 2091 |
Requeste a localized string from the frontend.
data1 | ID of the string to request, one of the MR_STR_* constants as defined in mrstock.h |
data2 | 0 |
#define MR_EVENT_GET_QUANTITY_STRING 2092 |
Requeste a localized quantitiy string from the frontend.
Quantitiy strings may have eg. different plural forms and usually also include the count itself to the string. Typical strings in this form are "1 Message" vs. "2 Messages".
data1 | ID of the string to request, one of the MR_STR_* constants as defined in mrstock.h |
data2 | The count. The frontend may retrurn different strings on this value and normally also includes the value itself to the string. |
#define MR_EVENT_HTTP_GET 2100 |
Request a HTTP-file from the frontend.
data1 | URL |
data2 | 0 |
#define MR_EVENT_WAKE_LOCK 2110 |
Acquire or release a wakelock.
The core surrounds critcal functions that should not be killed by the operating system with wakelocks. Before a critical function MR_EVENT_WAKE_LOCK with data1=1 is called, it it finishes, MR_EVENT_WAKE_LOCK with data1=0 is called. If you do not need this functionality, just ignore this event.
data1 | 1=acquire wakelock, 0=release wakelock, the core does not make nested or unsynchronized calls |
data2 | 0 |