Delta Chat Core C Interface
|
Macros | |
#define | DC_EVENT_ACCOUNTS_BACKGROUND_FETCH_DONE 2200 |
Tells that the Background fetch was completed (or timed out). | |
#define | DC_EVENT_CHANNEL_OVERFLOW 2400 |
Inform that some events have been skipped due to event channel overflow. | |
#define | DC_EVENT_CHAT_EPHEMERAL_TIMER_MODIFIED 2021 |
Chat ephemeral timer changed. | |
#define | DC_EVENT_CHAT_MODIFIED 2020 |
Chat changed. | |
#define | DC_EVENT_CHATLIST_CHANGED 2300 |
Inform that set of chats or the order of the chats in the chatlist has changed. | |
#define | DC_EVENT_CHATLIST_ITEM_CHANGED 2301 |
Inform that all or a single chat list item changed and needs to be rerendered If chat_id is set to 0, then all currently visible chats need to be rerendered, and all not-visible items need to be cleared from cache if the UI has a cache. | |
#define | DC_EVENT_CONFIG_SYNCED 2111 |
A multi-device synced config value changed. | |
#define | DC_EVENT_CONFIGURE_PROGRESS 2041 |
Inform about the configuration progress started by dc_configure(). | |
#define | DC_EVENT_CONNECTIVITY_CHANGED 2100 |
The connectivity to the server changed. | |
#define | DC_EVENT_CONTACTS_CHANGED 2030 |
Contact(s) created, renamed, verified, blocked or deleted. | |
#define | DC_EVENT_DELETED_BLOB_FILE 151 |
Emitted when a blob file was successfully deleted. | |
#define | DC_EVENT_ERROR 400 |
The library-user should report an error to the end-user. | |
#define | DC_EVENT_ERROR_SELF_NOT_IN_GROUP 410 |
An action cannot be performed because the user is not in the group. | |
#define | DC_EVENT_IMAP_CONNECTED 102 |
Emitted when IMAP connection is established and login was successful. | |
#define | DC_EVENT_IMAP_INBOX_IDLE 106 |
Emitted before going into IDLE on the Inbox folder. | |
#define | DC_EVENT_IMAP_MESSAGE_DELETED 104 |
Emitted when a message was successfully marked as deleted on the IMAP server. | |
#define | DC_EVENT_IMAP_MESSAGE_MOVED 105 |
Emitted when a message was successfully moved on IMAP. | |
#define | DC_EVENT_IMEX_FILE_WRITTEN 2052 |
A file has been exported. | |
#define | DC_EVENT_IMEX_PROGRESS 2051 |
Inform about the import/export progress started by dc_imex(). | |
#define | DC_EVENT_INCOMING_MSG 2005 |
There is a fresh message. | |
#define | DC_EVENT_INCOMING_MSG_BUNCH 2006 |
Downloading a bunch of messages just finished. | |
#define | DC_EVENT_INCOMING_REACTION 2002 |
A reaction to one's own sent message received. | |
#define | DC_EVENT_INFO 100 |
The library-user may write an informational string to the log. | |
#define | DC_EVENT_LOCATION_CHANGED 2035 |
Location of one or more contact has changed. | |
#define | DC_EVENT_MSG_DELETED 2016 |
A single message is deleted. | |
#define | DC_EVENT_MSG_DELIVERED 2010 |
A single message is sent successfully. | |
#define | DC_EVENT_MSG_FAILED 2012 |
A single message could not be sent. | |
#define | DC_EVENT_MSG_READ 2015 |
A single message is read by the receiver. | |
#define | DC_EVENT_MSGS_CHANGED 2000 |
Messages or chats changed. | |
#define | DC_EVENT_MSGS_NOTICED 2008 |
Messages were marked noticed or seen. | |
#define | DC_EVENT_NEW_BLOB_FILE 150 |
Emitted when a new blob file was successfully written. | |
#define | DC_EVENT_REACTIONS_CHANGED 2001 |
Message reactions changed. | |
#define | DC_EVENT_SECUREJOIN_INVITER_PROGRESS 2060 |
Progress information of a secure-join handshake from the view of the inviter (Alice, the person who shows the QR code). | |
#define | DC_EVENT_SECUREJOIN_JOINER_PROGRESS 2061 |
Progress information of a secure-join handshake from the view of the joiner (Bob, the person who scans the QR code). | |
#define | DC_EVENT_SELFAVATAR_CHANGED 2110 |
The user's avatar changed. | |
#define | DC_EVENT_SMTP_CONNECTED 101 |
Emitted when SMTP connection is established and login was successful. | |
#define | DC_EVENT_SMTP_MESSAGE_SENT 103 |
Emitted when a message was successfully sent to the SMTP server. | |
#define | DC_EVENT_WARNING 300 |
The library-user should write a warning string to the log. | |
#define | DC_EVENT_WEBXDC_INSTANCE_DELETED 2121 |
Message deleted which contained a webxdc instance. | |
#define | DC_EVENT_WEBXDC_REALTIME_ADVERTISEMENT 2151 |
Advertisement for ephemeral peer channel communication received. | |
#define | DC_EVENT_WEBXDC_REALTIME_DATA 2150 |
Data received over an ephemeral peer channel. | |
#define | DC_EVENT_WEBXDC_STATUS_UPDATE 2120 |
Webxdc status update received. | |
These constants are used as event ID in events returned by dc_get_next_event().
Events typically come with some additional data, use dc_event_get_data1_int(), dc_event_get_data2_int() and dc_event_get_data2_str() to read this data. The meaning of the data depends on the event.
#define DC_EVENT_ACCOUNTS_BACKGROUND_FETCH_DONE 2200 |
Tells that the Background fetch was completed (or timed out).
This event acts as a marker, when you reach this event you can be sure that all events emitted during the background fetch were processed.
This event is only emitted by the account manager
#define DC_EVENT_CHANNEL_OVERFLOW 2400 |
Inform that some events have been skipped due to event channel overflow.
data1 | (int) number of events that have been skipped |
#define DC_EVENT_CHAT_EPHEMERAL_TIMER_MODIFIED 2021 |
Chat ephemeral timer changed.
data1 | (int) chat_id |
data2 | (int) The timer value in seconds or 0 for disabled timer. |
#define DC_EVENT_CHAT_MODIFIED 2020 |
Chat changed.
The name or the image of a chat group was changed or members were added or removed. Or the verify state of a chat has changed. See dc_set_chat_name(), dc_set_chat_profile_image(), dc_add_contact_to_chat() and dc_remove_contact_from_chat().
data1 | (int) chat_id |
data2 | 0 |
#define DC_EVENT_CHATLIST_CHANGED 2300 |
Inform that set of chats or the order of the chats in the chatlist has changed.
Sometimes this is emitted together with DC_EVENT_CHATLIST_ITEM_CHANGED
.
#define DC_EVENT_CHATLIST_ITEM_CHANGED 2301 |
Inform that all or a single chat list item changed and needs to be rerendered If chat_id
is set to 0, then all currently visible chats need to be rerendered, and all not-visible items need to be cleared from cache if the UI has a cache.
data1 | (int) chat_id chat id of chatlist item to be rerendered, if chat_id = 0 all (cached & visible) items need to be rerendered |
#define DC_EVENT_CONFIG_SYNCED 2111 |
A multi-device synced config value changed.
Maybe the app needs to refresh smth. For uniformity this is emitted on the source device too. The value isn't reported, otherwise it would be logged which might not be good for privacy. You can get the new value with dc_get_config(context, data2)
.
data1 | 0 |
data2 | (char*) Configuration key. |
#define DC_EVENT_CONFIGURE_PROGRESS 2041 |
Inform about the configuration progress started by dc_configure().
data1 | (int) 0=error, 1-999=progress in permille, 1000=success and done. |
data2 | (char*) A progress comment, error message or NULL if not applicable. |
#define DC_EVENT_CONNECTIVITY_CHANGED 2100 |
The connectivity to the server changed.
This means that you should refresh the connectivity view and possibly the connectivtiy HTML; see dc_get_connectivity() and dc_get_connectivity_html() for details.
data1 | 0 |
data2 | 0 |
#define DC_EVENT_CONTACTS_CHANGED 2030 |
Contact(s) created, renamed, verified, blocked or deleted.
data1 | (int) contact_id of the changed contact or 0 on batch-changes or deletion. |
data2 | 0 |
#define DC_EVENT_DELETED_BLOB_FILE 151 |
Emitted when a blob file was successfully deleted.
data1 | 0 |
data2 | (char*) Path name |
#define DC_EVENT_ERROR 400 |
The library-user should report an error to the end-user.
As most things are asynchronous, things may go wrong at any time and the user should not be disturbed by a dialog or so. Instead, use a bubble or so.
However, for ongoing processes (e.g. dc_configure()) or for functions that are expected to fail (e.g. dc_continue_key_transfer()) it might be better to delay showing these events until the function has really failed (returned false). It should be sufficient to report only the last error in a message box then.
data1 | 0 |
data2 | (char*) Error string, always set, never NULL. Some error strings are taken from dc_set_stock_translation(), however, most error strings will be in English language. |
#define DC_EVENT_ERROR_SELF_NOT_IN_GROUP 410 |
An action cannot be performed because the user is not in the group.
Reported e.g. after a call to dc_set_chat_name(), dc_set_chat_profile_image(), dc_add_contact_to_chat(), dc_remove_contact_from_chat(), dc_send_text_msg() or another sending function.
data1 | 0 |
data2 | (char*) Info string in English language. |
#define DC_EVENT_IMAP_CONNECTED 102 |
Emitted when IMAP connection is established and login was successful.
data1 | 0 |
data2 | (char*) Info string in English language. |
#define DC_EVENT_IMAP_INBOX_IDLE 106 |
Emitted before going into IDLE on the Inbox folder.
data1 | 0 |
data2 | 0 |
#define DC_EVENT_IMAP_MESSAGE_DELETED 104 |
Emitted when a message was successfully marked as deleted on the IMAP server.
data1 | 0 |
data2 | (char*) Info string in English language. |
#define DC_EVENT_IMAP_MESSAGE_MOVED 105 |
Emitted when a message was successfully moved on IMAP.
data1 | 0 |
data2 | (char*) Info string in English language. |
#define DC_EVENT_IMEX_FILE_WRITTEN 2052 |
A file has been exported.
A file has been written by dc_imex(). This event may be sent multiple times by a single call to dc_imex().
A typical purpose for a handler of this event may be to make the file public to some system services.
data1 | 0 |
data2 | (char*) The path and the file name. |
#define DC_EVENT_IMEX_PROGRESS 2051 |
Inform about the import/export progress started by dc_imex().
data1 | (int) 0=error, 1-999=progress in permille, 1000=success and done |
data2 | 0 |
#define DC_EVENT_INCOMING_MSG 2005 |
There is a fresh message.
Typically, the user will show an notification when receiving this message.
There is no extra DC_EVENT_MSGS_CHANGED event send together with this event.
data1 | (int) chat_id |
data2 | (int) msg_id |
#define DC_EVENT_INCOMING_MSG_BUNCH 2006 |
Downloading a bunch of messages just finished.
This is an event to allow the UI to only show one notification per message bunch, instead of cluttering the user with many notifications. UI may store DC_EVENT_INCOMING_MSG events and display notifications for all messages at once when this event arrives.
data1 | 0 |
data2 | 0 |
#define DC_EVENT_INCOMING_REACTION 2002 |
A reaction to one's own sent message received.
Typically, the UI will show a notification for that.
In addition to this event, DC_EVENT_REACTIONS_CHANGED is emitted.
data1 | (int) contact_id ID of the contact sending this reaction. |
data2 | (int) msg_id + (char*) reaction. ID of the message for which a reaction was received in dc_event_get_data2_int(), and the reaction as dc_event_get_data2_str(). string must be passed to dc_str_unref() afterwards. |
#define DC_EVENT_INFO 100 |
The library-user may write an informational string to the log.
This event should not be reported to the end-user using a popup or something like that.
data1 | 0 |
data2 | (char*) Info string in English language. |
#define DC_EVENT_LOCATION_CHANGED 2035 |
Location of one or more contact has changed.
data1 | (int) contact_id of the contact for which the location has changed. If the locations of several contacts have been changed, e.g. after calling dc_delete_all_locations(), this parameter is set to 0. |
data2 | 0 |
#define DC_EVENT_MSG_DELETED 2016 |
A single message is deleted.
data1 | (int) chat_id |
data2 | (int) msg_id |
#define DC_EVENT_MSG_DELIVERED 2010 |
A single message is sent successfully.
State changed from DC_STATE_OUT_PENDING to DC_STATE_OUT_DELIVERED.
data1 | (int) chat_id |
data2 | (int) msg_id |
#define DC_EVENT_MSG_FAILED 2012 |
A single message could not be sent.
State changed from DC_STATE_OUT_PENDING, DC_STATE_OUT_DELIVERED or DC_STATE_OUT_MDN_RCVD to DC_STATE_OUT_FAILED.
data1 | (int) chat_id |
data2 | (int) msg_id |
#define DC_EVENT_MSG_READ 2015 |
A single message is read by the receiver.
State changed from DC_STATE_OUT_DELIVERED to DC_STATE_OUT_MDN_RCVD.
data1 | (int) chat_id |
data2 | (int) msg_id |
#define DC_EVENT_MSGS_CHANGED 2000 |
Messages or chats changed.
One or more messages or chats changed for various reasons in the database:
data1 | (int) chat_id if only a single chat is affected by the changes, otherwise 0. |
data2 | (int) msg_id if only a single message is affected by the changes, otherwise 0. |
#define DC_EVENT_MSGS_NOTICED 2008 |
Messages were marked noticed or seen.
The UI may update badge counters or stop showing a chatlist-item with a bold font.
This event is emitted e.g. when calling dc_markseen_msgs() or dc_marknoticed_chat() or when a chat is answered on another device. Do not try to derive the state of an item from just the fact you received the event; use e.g. dc_msg_get_state() or dc_get_fresh_msg_cnt() for this purpose.
data1 | (int) chat_id |
data2 | 0 |
#define DC_EVENT_NEW_BLOB_FILE 150 |
Emitted when a new blob file was successfully written.
data1 | 0 |
data2 | (char*) Path name |
#define DC_EVENT_REACTIONS_CHANGED 2001 |
Message reactions changed.
data1 | (int) chat_id ID of the chat affected by the changes. |
data2 | (int) msg_id ID of the message for which reactions were changed. |
#define DC_EVENT_SECUREJOIN_INVITER_PROGRESS 2060 |
Progress information of a secure-join handshake from the view of the inviter (Alice, the person who shows the QR code).
These events are typically sent after a joiner has scanned the QR code generated by dc_get_securejoin_qr().
data1 | (int) The ID of the contact that wants to join. |
data2 | (int) The progress as: 300=vg-/vc-request received, typically shown as "bob@addr joins". 600=vg-/vc-request-with-auth received, vg-member-added/vc-contact-confirm sent, typically shown as "bob@addr verified". 800=contact added to chat, shown as "bob@addr securely joined GROUP". Only for the verified-group-protocol. 1000=Protocol finished for this contact. |
#define DC_EVENT_SECUREJOIN_JOINER_PROGRESS 2061 |
Progress information of a secure-join handshake from the view of the joiner (Bob, the person who scans the QR code).
The events are typically sent while dc_join_securejoin(), which may take some time, is executed.
data1 | (int) The ID of the inviting contact. |
data2 | (int) The progress as: 400=vg-/vc-request-with-auth sent, typically shown as "alice@addr verified, introducing myself." (Bob has verified alice and waits until Alice does the same for him) 1000=vg-member-added/vc-contact-confirm received |
#define DC_EVENT_SELFAVATAR_CHANGED 2110 |
The user's avatar changed.
You can get the new avatar file with dc_get_config(context, "selfavatar")
.
#define DC_EVENT_SMTP_CONNECTED 101 |
Emitted when SMTP connection is established and login was successful.
data1 | 0 |
data2 | (char*) Info string in English language. |
#define DC_EVENT_SMTP_MESSAGE_SENT 103 |
Emitted when a message was successfully sent to the SMTP server.
data1 | 0 |
data2 | (char*) Info string in English language. |
#define DC_EVENT_WARNING 300 |
The library-user should write a warning string to the log.
This event should not be reported to the end-user using a popup or something like that.
data1 | 0 |
data2 | (char*) Warning string in English language. |
#define DC_EVENT_WEBXDC_INSTANCE_DELETED 2121 |
Message deleted which contained a webxdc instance.
data1 | (int) msg_id |
#define DC_EVENT_WEBXDC_REALTIME_ADVERTISEMENT 2151 |
Advertisement for ephemeral peer channel communication received.
This can be used by bots to initiate peer-to-peer communication from their side.
data1 | (int) msg_id |
data2 | 0 |
#define DC_EVENT_WEBXDC_REALTIME_DATA 2150 |
Data received over an ephemeral peer channel.
data1 | (int) msg_id |
data2 | (int) + (char*) binary data. length is returned as integer with dc_event_get_data2_int() and binary data is returned as dc_event_get_data2_str(). Binary data must be passed to dc_str_unref() afterwards. |
#define DC_EVENT_WEBXDC_STATUS_UPDATE 2120 |
Webxdc status update received.
To get the received status update, use dc_get_webxdc_status_updates() with serial
set to the last known update (in case of special bots, status_update_serial
from data2
may help to calculate the last known update for dc_get_webxdc_status_updates(); UIs must not peek at this parameter to avoid races in the status replication eg. when events arrive while initial updates are played back).
To send status updates, use dc_send_webxdc_status_update().
data1 | (int) msg_id |
data2 | (int) status_update_serial - must not be used by UI implementations. |