Delta Chat Core C Interface
deltachat.h
1 #ifndef __DELTACHAT_H__
2 #define __DELTACHAT_H__
3 #ifdef __cplusplus
4 extern "C" {
5 #endif
6 
7 
8 #ifndef PY_CFFI
9 #include <stdint.h>
10 #include <time.h>
11 #endif
12 
13 
14 typedef struct _dc_context dc_context_t;
15 typedef struct _dc_accounts dc_accounts_t;
16 typedef struct _dc_array dc_array_t;
17 typedef struct _dc_chatlist dc_chatlist_t;
18 typedef struct _dc_chat dc_chat_t;
19 typedef struct _dc_msg dc_msg_t;
20 typedef struct _dc_contact dc_contact_t;
21 typedef struct _dc_lot dc_lot_t;
22 typedef struct _dc_provider dc_provider_t;
23 typedef struct _dc_event dc_event_t;
24 typedef struct _dc_event_emitter dc_event_emitter_t;
25 typedef struct _dc_accounts_event_emitter dc_accounts_event_emitter_t;
26 
27 
179 // create/open/config/information
180 
199 dc_context_t* dc_context_new (const char* os_name, const char* dbfile, const char* blobdir);
200 
201 
213 void dc_context_unref (dc_context_t* context);
214 
215 
227 uint32_t dc_get_id (dc_context_t* context);
228 
229 
246 
247 
256 char* dc_get_blobdir (const dc_context_t* context);
257 
258 
358 int dc_set_config (dc_context_t* context, const char* key, const char* value);
359 
360 
383 char* dc_get_config (dc_context_t* context, const char* key);
384 
385 
397 int dc_set_stock_translation(dc_context_t* context, uint32_t stock_id, const char* stock_msg);
398 
399 
414 int dc_set_config_from_qr (dc_context_t* context, const char* qr);
415 
416 
431 char* dc_get_info (const dc_context_t* context);
432 
433 
463 char* dc_get_oauth2_url (dc_context_t* context, const char* addr, const char* redirect_uri);
464 
465 
466 #define DC_CONNECTIVITY_NOT_CONNECTED 1000
467 #define DC_CONNECTIVITY_CONNECTING 2000
468 #define DC_CONNECTIVITY_WORKING 3000
469 #define DC_CONNECTIVITY_CONNECTED 4000
470 
471 
492 int dc_get_connectivity (dc_context_t* context);
493 
494 
510 char* dc_get_connectivity_html (dc_context_t* context);
511 
512 
517 int dc_all_work_done (dc_context_t* context);
518 
519 
520 // connect
521 
572 void dc_configure (dc_context_t* context);
573 
574 
586 int dc_is_configured (const dc_context_t* context);
587 
588 
599 void dc_start_io (dc_context_t* context);
600 
615 void dc_stop_io(dc_context_t* context);
616 
639 void dc_maybe_network (dc_context_t* context);
640 
641 
642 
661 int dc_preconfigure_keypair (dc_context_t* context, const char *addr, const char *public_data, const char *secret_data);
662 
663 
664 // handle chatlists
665 
666 #define DC_GCL_ARCHIVED_ONLY 0x01
667 #define DC_GCL_NO_SPECIALS 0x02
668 #define DC_GCL_ADD_ALLDONE_HINT 0x04
669 #define DC_GCL_FOR_FORWARDING 0x08
670 
671 
720 dc_chatlist_t* dc_get_chatlist (dc_context_t* context, int flags, const char* query_str, uint32_t query_id);
721 
722 
723 // handle chats
724 
738 uint32_t dc_create_chat_by_contact_id (dc_context_t* context, uint32_t contact_id);
739 
740 
752 uint32_t dc_get_chat_id_by_contact_id (dc_context_t* context, uint32_t contact_id);
753 
754 
800 uint32_t dc_prepare_msg (dc_context_t* context, uint32_t chat_id, dc_msg_t* msg);
801 
802 
840 uint32_t dc_send_msg (dc_context_t* context, uint32_t chat_id, dc_msg_t* msg);
841 
857 uint32_t dc_send_msg_sync (dc_context_t* context, uint32_t chat_id, dc_msg_t* msg);
858 
859 
879 uint32_t dc_send_text_msg (dc_context_t* context, uint32_t chat_id, const char* text_to_send);
880 
881 
915 uint32_t dc_send_videochat_invitation (dc_context_t* context, uint32_t chat_id);
916 
917 
943 void dc_set_draft (dc_context_t* context, uint32_t chat_id, dc_msg_t* msg);
944 
945 
993 uint32_t dc_add_device_msg (dc_context_t* context, const char* label, dc_msg_t* msg);
994 
1005 int dc_was_device_msg_ever_added (dc_context_t* context, const char* label);
1006 
1007 
1020 dc_msg_t* dc_get_draft (dc_context_t* context, uint32_t chat_id);
1021 
1022 
1023 #define DC_GCM_ADDDAYMARKER 0x01
1024 #define DC_GCM_INFO_ONLY 0x02
1025 
1026 
1048 dc_array_t* dc_get_chat_msgs (dc_context_t* context, uint32_t chat_id, uint32_t flags, uint32_t marker1before);
1049 
1050 
1059 int dc_get_msg_cnt (dc_context_t* context, uint32_t chat_id);
1060 
1061 
1075 int dc_get_fresh_msg_cnt (dc_context_t* context, uint32_t chat_id);
1076 
1077 
1078 
1093 int dc_estimate_deletion_cnt (dc_context_t* context, int from_server, int64_t seconds);
1094 
1095 
1115 
1116 
1130 void dc_marknoticed_chat (dc_context_t* context, uint32_t chat_id);
1131 
1132 
1150 dc_array_t* dc_get_chat_media (dc_context_t* context, uint32_t chat_id, int msg_type, int msg_type2, int msg_type3);
1151 
1152 
1175 uint32_t dc_get_next_media (dc_context_t* context, uint32_t msg_id, int dir, int msg_type, int msg_type2, int msg_type3);
1176 
1177 
1193 int dc_set_chat_protection (dc_context_t* context, uint32_t chat_id, int protect);
1194 
1195 
1207 void dc_set_chat_visibility (dc_context_t* context, uint32_t chat_id, int visibility);
1208 
1209 
1235 void dc_delete_chat (dc_context_t* context, uint32_t chat_id);
1236 
1250 void dc_block_chat (dc_context_t* context, uint32_t chat_id);
1251 
1261 void dc_accept_chat (dc_context_t* context, uint32_t chat_id);
1262 
1283 dc_array_t* dc_get_chat_contacts (dc_context_t* context, uint32_t chat_id);
1284 
1295 char* dc_get_chat_encrinfo (dc_context_t* context, uint32_t chat_id);
1296 
1308 uint32_t dc_get_chat_ephemeral_timer (dc_context_t* context, uint32_t chat_id);
1309 
1333 dc_array_t* dc_search_msgs (dc_context_t* context, uint32_t chat_id, const char* query);
1334 
1335 
1346 dc_chat_t* dc_get_chat (dc_context_t* context, uint32_t chat_id);
1347 
1348 
1349 // handle group chats
1350 
1379 uint32_t dc_create_group_chat (dc_context_t* context, int protect, const char* name);
1380 
1381 
1392 int dc_is_contact_in_chat (dc_context_t* context, uint32_t chat_id, uint32_t contact_id);
1393 
1394 
1411 int dc_add_contact_to_chat (dc_context_t* context, uint32_t chat_id, uint32_t contact_id);
1412 
1413 
1428 int dc_remove_contact_from_chat (dc_context_t* context, uint32_t chat_id, uint32_t contact_id);
1429 
1430 
1445 int dc_set_chat_name (dc_context_t* context, uint32_t chat_id, const char* name);
1446 
1464 int dc_set_chat_ephemeral_timer (dc_context_t* context, uint32_t chat_id, uint32_t timer);
1465 
1485 int dc_set_chat_profile_image (dc_context_t* context, uint32_t chat_id, const char* image);
1486 
1487 
1488 
1510 int dc_set_chat_mute_duration (dc_context_t* context, uint32_t chat_id, int64_t duration);
1511 
1512 // handle messages
1513 
1526 char* dc_get_msg_info (dc_context_t* context, uint32_t msg_id);
1527 
1528 
1576 char* dc_get_msg_html (dc_context_t* context, uint32_t msg_id);
1577 
1578 
1593 char* dc_get_mime_headers (dc_context_t* context, uint32_t msg_id);
1594 
1595 
1605 void dc_delete_msgs (dc_context_t* context, const uint32_t* msg_ids, int msg_cnt);
1606 
1607 
1617 void dc_forward_msgs (dc_context_t* context, const uint32_t* msg_ids, int msg_cnt, uint32_t chat_id);
1618 
1619 
1645 void dc_markseen_msgs (dc_context_t* context, const uint32_t* msg_ids, int msg_cnt);
1646 
1647 
1660 dc_msg_t* dc_get_msg (dc_context_t* context, uint32_t msg_id);
1661 
1662 
1663 // handle contacts
1664 
1678 int dc_may_be_valid_addr (const char* addr);
1679 
1680 
1694 uint32_t dc_lookup_contact_id_by_addr (dc_context_t* context, const char* addr);
1695 
1696 
1717 uint32_t dc_create_contact (dc_context_t* context, const char* name, const char* addr);
1718 
1719 
1720 #define DC_GCL_VERIFIED_ONLY 0x01
1721 #define DC_GCL_ADD_SELF 0x02
1722 
1723 
1747 int dc_add_address_book (dc_context_t* context, const char* addr_book);
1748 
1749 
1766 dc_array_t* dc_get_contacts (dc_context_t* context, uint32_t flags, const char* query);
1767 
1768 
1777 int dc_get_blocked_cnt (dc_context_t* context);
1778 
1779 
1789 
1790 
1800 void dc_block_contact (dc_context_t* context, uint32_t contact_id, int block);
1801 
1802 
1813 char* dc_get_contact_encrinfo (dc_context_t* context, uint32_t contact_id);
1814 
1815 
1827 int dc_delete_contact (dc_context_t* context, uint32_t contact_id);
1828 
1829 
1843 dc_contact_t* dc_get_contact (dc_context_t* context, uint32_t contact_id);
1844 
1845 
1846 // import/export and tools
1847 
1848 #define DC_IMEX_EXPORT_SELF_KEYS 1 // param1 is a directory where the keys are written to
1849 #define DC_IMEX_IMPORT_SELF_KEYS 2 // param1 is a directory where the keys are searched in and read from
1850 #define DC_IMEX_EXPORT_BACKUP 11 // param1 is a directory where the backup is written to
1851 #define DC_IMEX_IMPORT_BACKUP 12 // param1 is the file with the backup to import
1852 
1853 
1897 void dc_imex (dc_context_t* context, int what, const char* param1, const char* param2);
1898 
1899 
1949 char* dc_imex_has_backup (dc_context_t* context, const char* dir);
1950 
1951 
1997 char* dc_initiate_key_transfer (dc_context_t* context);
1998 
1999 
2020 int dc_continue_key_transfer (dc_context_t* context, uint32_t msg_id, const char* setup_code);
2021 
2022 
2039 void dc_stop_ongoing_process (dc_context_t* context);
2040 
2041 
2042 // out-of-band verification
2043 
2044 #define DC_QR_ASK_VERIFYCONTACT 200 // id=contact
2045 #define DC_QR_ASK_VERIFYGROUP 202 // text1=groupname
2046 #define DC_QR_FPR_OK 210 // id=contact
2047 #define DC_QR_FPR_MISMATCH 220 // id=contact
2048 #define DC_QR_FPR_WITHOUT_ADDR 230 // test1=formatted fingerprint
2049 #define DC_QR_ACCOUNT 250 // text1=domain
2050 #define DC_QR_WEBRTC_INSTANCE 260 // text1=domain
2051 #define DC_QR_ADDR 320 // id=contact
2052 #define DC_QR_TEXT 330 // text1=text
2053 #define DC_QR_URL 332 // text1=URL
2054 #define DC_QR_ERROR 400 // text1=error string
2055 #define DC_QR_WITHDRAW_VERIFYCONTACT 500
2056 #define DC_QR_WITHDRAW_VERIFYGROUP 502 // text1=groupname
2057 #define DC_QR_REVIVE_VERIFYCONTACT 510
2058 #define DC_QR_REVIVE_VERIFYGROUP 512 // text1=groupname
2059 
2136 dc_lot_t* dc_check_qr (dc_context_t* context, const char* qr);
2137 
2138 
2160 char* dc_get_securejoin_qr (dc_context_t* context, uint32_t chat_id);
2161 
2162 
2198 uint32_t dc_join_securejoin (dc_context_t* context, const char* qr);
2199 
2200 
2201 // location streaming
2202 
2203 
2220 void dc_send_locations_to_chat (dc_context_t* context, uint32_t chat_id, int seconds);
2221 
2222 
2236 int dc_is_sending_locations_to_chat (dc_context_t* context, uint32_t chat_id);
2237 
2238 
2266 int dc_set_location (dc_context_t* context, double latitude, double longitude, double accuracy);
2267 
2268 
2329 dc_array_t* dc_get_locations (dc_context_t* context, uint32_t chat_id, uint32_t contact_id, int64_t timestamp_begin, int64_t timestamp_end);
2330 
2331 
2342 void dc_delete_all_locations (dc_context_t* context);
2343 
2344 
2357 void dc_str_unref (char* str);
2358 
2359 
2406 dc_accounts_t* dc_accounts_new (const char* os_name, const char* dir);
2407 
2408 
2415 void dc_accounts_unref (dc_accounts_t* accounts);
2416 
2417 
2433 uint32_t dc_accounts_add_account (dc_accounts_t* accounts);
2434 
2435 
2450 uint32_t dc_accounts_migrate_account (dc_accounts_t* accounts, const char* dbfile);
2451 
2452 
2464 int dc_accounts_remove_account (dc_accounts_t* accounts, uint32_t account_id);
2465 
2466 
2476 
2477 
2489 dc_context_t* dc_accounts_get_account (dc_accounts_t* accounts, uint32_t account_id);
2490 
2491 
2508 
2509 
2518 int dc_accounts_select_account (dc_accounts_t* accounts, uint32_t account_id);
2519 
2520 
2536 
2537 
2547 void dc_accounts_start_io (dc_accounts_t* accounts);
2548 
2549 
2558 void dc_accounts_stop_io (dc_accounts_t* accounts);
2559 
2560 
2570 void dc_accounts_maybe_network (dc_accounts_t* accounts);
2571 
2572 
2586 
2587 
2608 
2609 
2628 void dc_array_unref (dc_array_t* array);
2629 
2630 
2638 size_t dc_array_get_cnt (const dc_array_t* array);
2639 
2640 
2649 uint32_t dc_array_get_id (const dc_array_t* array, size_t index);
2650 
2651 
2661 double dc_array_get_latitude (const dc_array_t* array, size_t index);
2662 
2663 
2673 double dc_array_get_longitude (const dc_array_t* array, size_t index);
2674 
2675 
2686 double dc_array_get_accuracy (const dc_array_t* array, size_t index);
2687 
2688 
2698 int64_t dc_array_get_timestamp (const dc_array_t* array, size_t index);
2699 
2700 
2710 uint32_t dc_array_get_chat_id (const dc_array_t* array, size_t index);
2711 
2712 
2722 uint32_t dc_array_get_contact_id (const dc_array_t* array, size_t index);
2723 
2724 
2734 uint32_t dc_array_get_msg_id (const dc_array_t* array, size_t index);
2735 
2736 
2751 char* dc_array_get_marker (const dc_array_t* array, size_t index);
2752 
2753 
2764 int dc_array_is_independent (const dc_array_t* array, size_t index);
2765 
2766 
2776 int dc_array_search_id (const dc_array_t* array, uint32_t needle, size_t* ret_index);
2777 
2778 
2820 void dc_chatlist_unref (dc_chatlist_t* chatlist);
2821 
2822 
2830 size_t dc_chatlist_get_cnt (const dc_chatlist_t* chatlist);
2831 
2832 
2844 uint32_t dc_chatlist_get_chat_id (const dc_chatlist_t* chatlist, size_t index);
2845 
2846 
2858 uint32_t dc_chatlist_get_msg_id (const dc_chatlist_t* chatlist, size_t index);
2859 
2860 
2887 dc_lot_t* dc_chatlist_get_summary (const dc_chatlist_t* chatlist, size_t index, dc_chat_t* chat);
2888 
2889 
2909 dc_lot_t* dc_chatlist_get_summary2 (dc_context_t* context, uint32_t chat_id, uint32_t msg_id);
2910 
2911 
2920 
2921 
2938 char* dc_chat_get_info_json (dc_context_t* context, size_t chat_id);
2939 
2950 #define DC_CHAT_ID_TRASH 3 // messages that should be deleted get this chat_id; the messages are deleted from the working thread later then. This is also needed as rfc724_mid should be preset as long as the message is not deleted on the server (otherwise it is downloaded again)
2951 #define DC_CHAT_ID_ARCHIVED_LINK 6 // only an indicator in a chatlist
2952 #define DC_CHAT_ID_ALLDONE_HINT 7 // only an indicator in a chatlist
2953 #define DC_CHAT_ID_LAST_SPECIAL 9 // larger chat IDs are "real" chats, their messages are "real" messages.
2954 
2955 
2956 #define DC_CHAT_TYPE_UNDEFINED 0
2957 #define DC_CHAT_TYPE_SINGLE 100
2958 #define DC_CHAT_TYPE_GROUP 120
2959 #define DC_CHAT_TYPE_MAILINGLIST 140
2960 
2961 
2969 void dc_chat_unref (dc_chat_t* chat);
2970 
2971 
2984 uint32_t dc_chat_get_id (const dc_chat_t* chat);
2985 
2986 
3008 int dc_chat_get_type (const dc_chat_t* chat);
3009 
3010 
3022 char* dc_chat_get_name (const dc_chat_t* chat);
3023 
3024 
3038 char* dc_chat_get_profile_image (const dc_chat_t* chat);
3039 
3040 
3053 uint32_t dc_chat_get_color (const dc_chat_t* chat);
3054 
3055 
3064 int dc_chat_get_visibility (const dc_chat_t* chat);
3065 
3066 
3083 int dc_chat_is_contact_request (const dc_chat_t* chat);
3084 
3085 
3106 int dc_chat_is_unpromoted (const dc_chat_t* chat);
3107 
3108 
3117 int dc_chat_is_self_talk (const dc_chat_t* chat);
3118 
3119 
3134 int dc_chat_is_device_talk (const dc_chat_t* chat);
3135 
3136 
3148 int dc_chat_can_send (const dc_chat_t* chat);
3149 
3150 
3161 int dc_chat_is_protected (const dc_chat_t* chat);
3162 
3163 
3174 int dc_chat_is_sending_locations (const dc_chat_t* chat);
3175 
3176 
3184 int dc_chat_is_muted (const dc_chat_t* chat);
3185 
3186 
3194 int64_t dc_chat_get_remaining_mute_duration (const dc_chat_t* chat);
3195 
3196 
3206 #define DC_MSG_ID_MARKER1 1
3207 #define DC_MSG_ID_DAYMARKER 9
3208 #define DC_MSG_ID_LAST_SPECIAL 9
3209 
3210 
3211 #define DC_STATE_UNDEFINED 0
3212 #define DC_STATE_IN_FRESH 10
3213 #define DC_STATE_IN_NOTICED 13
3214 #define DC_STATE_IN_SEEN 16
3215 #define DC_STATE_OUT_PREPARING 18
3216 #define DC_STATE_OUT_DRAFT 19
3217 #define DC_STATE_OUT_PENDING 20
3218 #define DC_STATE_OUT_FAILED 24
3219 #define DC_STATE_OUT_DELIVERED 26 // to check if a mail was sent, use dc_msg_is_sent()
3220 #define DC_STATE_OUT_MDN_RCVD 28
3221 
3222 
3223 #define DC_MAX_GET_TEXT_LEN 30000 // approx. max. length returned by dc_msg_get_text()
3224 #define DC_MAX_GET_INFO_LEN 100000 // approx. max. length returned by dc_get_msg_info()
3225 
3226 
3239 dc_msg_t* dc_msg_new (dc_context_t* context, int viewtype);
3240 
3241 
3249 void dc_msg_unref (dc_msg_t* msg);
3250 
3251 
3260 uint32_t dc_msg_get_id (const dc_msg_t* msg);
3261 
3262 
3277 uint32_t dc_msg_get_from_id (const dc_msg_t* msg);
3278 
3279 
3288 uint32_t dc_msg_get_chat_id (const dc_msg_t* msg);
3289 
3290 
3299 int dc_msg_get_viewtype (const dc_msg_t* msg);
3300 
3301 
3335 int dc_msg_get_state (const dc_msg_t* msg);
3336 
3337 
3354 int64_t dc_msg_get_timestamp (const dc_msg_t* msg);
3355 
3356 
3368 int64_t dc_msg_get_received_timestamp (const dc_msg_t* msg);
3369 
3370 
3384 int64_t dc_msg_get_sort_timestamp (const dc_msg_t* msg);
3385 
3386 
3406 char* dc_msg_get_text (const dc_msg_t* msg);
3407 
3408 
3426 char* dc_msg_get_subject (const dc_msg_t* msg);
3427 
3441 char* dc_msg_get_file (const dc_msg_t* msg);
3442 
3443 
3454 char* dc_msg_get_filename (const dc_msg_t* msg);
3455 
3456 
3467 char* dc_msg_get_filemime (const dc_msg_t* msg);
3468 
3469 
3480 uint64_t dc_msg_get_filebytes (const dc_msg_t* msg);
3481 
3482 
3497 int dc_msg_get_width (const dc_msg_t* msg);
3498 
3499 
3514 int dc_msg_get_height (const dc_msg_t* msg);
3515 
3516 
3528 int dc_msg_get_duration (const dc_msg_t* msg);
3529 
3530 
3538 int dc_msg_get_showpadlock (const dc_msg_t* msg);
3539 
3549 int dc_msg_is_bot (const dc_msg_t* msg);
3550 
3562 uint32_t dc_msg_get_ephemeral_timer (const dc_msg_t* msg);
3563 
3576 int64_t dc_msg_get_ephemeral_timestamp (const dc_msg_t* msg);
3577 
3578 
3601 dc_lot_t* dc_msg_get_summary (const dc_msg_t* msg, const dc_chat_t* chat);
3602 
3603 
3615 char* dc_msg_get_summarytext (const dc_msg_t* msg, int approx_characters);
3616 
3617 
3646 char* dc_msg_get_override_sender_name(const dc_msg_t* msg);
3647 
3648 
3649 
3665 
3666 
3676 int dc_msg_has_location (const dc_msg_t* msg);
3677 
3678 
3689 int dc_msg_is_sent (const dc_msg_t* msg);
3690 
3691 
3708 int dc_msg_is_forwarded (const dc_msg_t* msg);
3709 
3710 
3728 int dc_msg_is_info (const dc_msg_t* msg);
3729 
3730 
3749 int dc_msg_get_info_type (const dc_msg_t* msg);
3750 
3751 
3752 // DC_INFO* uses the same values as SystemMessage in rust-land
3753 #define DC_INFO_PROTECTION_ENABLED 11
3754 #define DC_INFO_PROTECTION_DISABLED 12
3755 
3756 
3769 int dc_msg_is_increation (const dc_msg_t* msg);
3770 
3771 
3786 int dc_msg_is_setupmessage (const dc_msg_t* msg);
3787 
3788 
3803 char* dc_msg_get_setupcodebegin (const dc_msg_t* msg);
3804 
3805 
3819 char* dc_msg_get_videochat_url (const dc_msg_t* msg);
3820 
3821 
3841 char* dc_msg_get_error (const dc_msg_t* msg);
3842 
3843 
3872 int dc_msg_get_videochat_type (const dc_msg_t* msg);
3873 
3874 #define DC_VIDEOCHATTYPE_UNKNOWN 0
3875 #define DC_VIDEOCHATTYPE_BASICWEBRTC 1
3876 #define DC_VIDEOCHATTYPE_JITSI 2
3877 
3878 
3902 int dc_msg_has_html (dc_msg_t* msg);
3903 
3904 
3913 void dc_msg_set_text (dc_msg_t* msg, const char* text);
3914 
3915 
3940 void dc_msg_set_html (dc_msg_t* msg, const char* html);
3941 
3942 
3955 void dc_msg_set_override_sender_name(dc_msg_t* msg, const char* name);
3956 
3957 
3970 void dc_msg_set_file (dc_msg_t* msg, const char* file, const char* filemime);
3971 
3972 
3983 void dc_msg_set_dimension (dc_msg_t* msg, int width, int height);
3984 
3985 
3995 void dc_msg_set_duration (dc_msg_t* msg, int duration);
3996 
3997 
4014 void dc_msg_set_location (dc_msg_t* msg, double latitude, double longitude);
4015 
4016 
4038 void dc_msg_latefiling_mediasize (dc_msg_t* msg, int width, int height, int duration);
4039 
4040 
4054 void dc_msg_set_quote (dc_msg_t* msg, const dc_msg_t* quote);
4055 
4056 
4071 char* dc_msg_get_quoted_text (const dc_msg_t* msg);
4072 
4073 
4096 
4097 
4119 #define DC_CONTACT_ID_SELF 1
4120 #define DC_CONTACT_ID_INFO 2 // centered messages as "member added", used in all chats
4121 #define DC_CONTACT_ID_DEVICE 5 // messages "update info" in the device-chat
4122 #define DC_CONTACT_ID_LAST_SPECIAL 9
4123 
4124 
4132 void dc_contact_unref (dc_contact_t* contact);
4133 
4134 
4142 uint32_t dc_contact_get_id (const dc_contact_t* contact);
4143 
4144 
4153 char* dc_contact_get_addr (const dc_contact_t* contact);
4154 
4155 
4170 char* dc_contact_get_name (const dc_contact_t* contact);
4171 
4172 
4192 char* dc_contact_get_auth_name (const dc_contact_t* contact);
4193 
4194 
4210 char* dc_contact_get_display_name (const dc_contact_t* contact);
4211 
4212 
4213 // dc_contact_get_first_name is removed,
4214 // the following define is to make upgrading more smoothly.
4215 #define dc_contact_get_first_name dc_contact_get_display_name
4216 
4217 
4232 char* dc_contact_get_name_n_addr (const dc_contact_t* contact);
4233 
4234 
4246 char* dc_contact_get_profile_image (const dc_contact_t* contact);
4247 
4248 
4260 uint32_t dc_contact_get_color (const dc_contact_t* contact);
4261 
4262 
4274 char* dc_contact_get_status (const dc_contact_t* contact);
4275 
4285 int dc_contact_is_blocked (const dc_contact_t* contact);
4286 
4287 
4299 int dc_contact_is_verified (dc_contact_t* contact);
4300 
4301 
4321 dc_provider_t* dc_provider_new_from_email (const dc_context_t* context, const char* email);
4322 
4323 
4335 char* dc_provider_get_overview_page (const dc_provider_t* provider);
4336 
4337 
4352 char* dc_provider_get_before_login_hint (const dc_provider_t* provider);
4353 
4354 
4365 int dc_provider_get_status (const dc_provider_t* provider);
4366 
4367 
4374 void dc_provider_unref (dc_provider_t* provider);
4375 
4376 
4389 #define DC_TEXT1_DRAFT 1
4390 #define DC_TEXT1_USERNAME 2
4391 #define DC_TEXT1_SELF 3
4392 
4393 
4403 void dc_lot_unref (dc_lot_t* lot);
4404 
4405 
4415 char* dc_lot_get_text1 (const dc_lot_t* lot);
4416 
4417 
4427 char* dc_lot_get_text2 (const dc_lot_t* lot);
4428 
4429 
4439 int dc_lot_get_text1_meaning (const dc_lot_t* lot);
4440 
4441 
4449 int dc_lot_get_state (const dc_lot_t* lot);
4450 
4451 
4459 uint32_t dc_lot_get_id (const dc_lot_t* lot);
4460 
4461 
4471 int64_t dc_lot_get_timestamp (const dc_lot_t* lot);
4472 
4473 
4503 #define DC_MSG_TEXT 10
4504 
4505 
4517 #define DC_MSG_IMAGE 20
4518 
4519 
4525 #define DC_MSG_GIF 21
4526 
4527 
4533 #define DC_MSG_STICKER 23
4534 
4535 
4541 #define DC_MSG_AUDIO 40
4542 
4543 
4550 #define DC_MSG_VOICE 41
4551 
4552 
4561 #define DC_MSG_VIDEO 50
4562 
4563 
4569 #define DC_MSG_FILE 60
4570 
4571 
4580 #define DC_MSG_VIDEOCHAT_INVITATION 70
4581 
4601 #define DC_SOCKET_AUTO 0
4602 
4603 
4607 #define DC_SOCKET_SSL 1
4608 
4609 
4613 #define DC_SOCKET_STARTTLS 2
4614 
4615 
4619 #define DC_SOCKET_PLAIN 3
4620 
4644 #define DC_LP_AUTH_OAUTH2 0x2
4645 
4646 
4651 #define DC_LP_AUTH_NORMAL 0x4
4652 
4653 
4658 #define DC_LP_AUTH_FLAGS (DC_LP_AUTH_OAUTH2|DC_LP_AUTH_NORMAL) // if none of these flags are set, the default is chosen
4659 
4675 #define DC_CERTCK_AUTO 0
4676 
4681 #define DC_CERTCK_STRICT 1
4682 
4687 #define DC_CERTCK_ACCEPT_INVALID_CERTIFICATES 3
4688 
4715 
4716 
4725 
4726 
4748 
4749 
4758 
4759 
4778 int dc_event_get_id(dc_event_t* event);
4779 
4780 
4793 
4794 
4807 
4808 
4821 char* dc_event_get_data2_str(dc_event_t* event);
4822 
4823 
4833 uint32_t dc_event_get_account_id(dc_event_t* event);
4834 
4835 
4843 void dc_event_unref(dc_event_t* event);
4844 
4845 
4868 #define DC_EVENT_INFO 100
4869 
4870 
4877 #define DC_EVENT_SMTP_CONNECTED 101
4878 
4879 
4886 #define DC_EVENT_IMAP_CONNECTED 102
4887 
4894 #define DC_EVENT_SMTP_MESSAGE_SENT 103
4895 
4902 #define DC_EVENT_IMAP_MESSAGE_DELETED 104
4903 
4910 #define DC_EVENT_IMAP_MESSAGE_MOVED 105
4911 
4918 #define DC_EVENT_NEW_BLOB_FILE 150
4919 
4926 #define DC_EVENT_DELETED_BLOB_FILE 151
4927 
4936 #define DC_EVENT_WARNING 300
4937 
4938 
4956 #define DC_EVENT_ERROR 400
4957 
4958 
4969 #define DC_EVENT_ERROR_SELF_NOT_IN_GROUP 410
4970 
4971 
4982 #define DC_EVENT_MSGS_CHANGED 2000
4983 
4984 
4994 #define DC_EVENT_INCOMING_MSG 2005
4995 
4996 
5009 #define DC_EVENT_MSGS_NOTICED 2008
5010 
5011 
5019 #define DC_EVENT_MSG_DELIVERED 2010
5020 
5021 
5030 #define DC_EVENT_MSG_FAILED 2012
5031 
5032 
5040 #define DC_EVENT_MSG_READ 2015
5041 
5042 
5052 #define DC_EVENT_CHAT_MODIFIED 2020
5053 
5057 #define DC_EVENT_CHAT_EPHEMERAL_TIMER_MODIFIED 2021
5058 
5059 
5066 #define DC_EVENT_CONTACTS_CHANGED 2030
5067 
5068 
5069 
5078 #define DC_EVENT_LOCATION_CHANGED 2035
5079 
5080 
5087 #define DC_EVENT_CONFIGURE_PROGRESS 2041
5088 
5089 
5096 #define DC_EVENT_IMEX_PROGRESS 2051
5097 
5098 
5109 #define DC_EVENT_IMEX_FILE_WRITTEN 2052
5110 
5111 
5126 #define DC_EVENT_SECUREJOIN_INVITER_PROGRESS 2060
5127 
5128 
5141 #define DC_EVENT_SECUREJOIN_JOINER_PROGRESS 2061
5142 
5143 
5153 #define DC_EVENT_CONNECTIVITY_CHANGED 2100
5154 
5160 #define DC_EVENT_DATA1_IS_STRING(e) 0 // not used anymore
5161 #define DC_EVENT_DATA2_IS_STRING(e) ((e)==DC_EVENT_CONFIGURE_PROGRESS || (e)==DC_EVENT_IMEX_FILE_WRITTEN || ((e)>=100 && (e)<=499))
5162 
5163 
5164 /*
5165  * Values for dc_get|set_config("show_emails")
5166  */
5167 #define DC_SHOW_EMAILS_OFF 0
5168 #define DC_SHOW_EMAILS_ACCEPTED_CONTACTS 1
5169 #define DC_SHOW_EMAILS_ALL 2
5170 
5171 
5172 /*
5173  * Values for dc_get|set_config("media_quality")
5174  */
5175 #define DC_MEDIA_QUALITY_BALANCED 0
5176 #define DC_MEDIA_QUALITY_WORSE 1
5177 
5178 
5179 /*
5180  * Values for dc_get|set_config("key_gen_type")
5181  */
5182 #define DC_KEY_GEN_DEFAULT 0
5183 #define DC_KEY_GEN_RSA2048 1
5184 #define DC_KEY_GEN_ED25519 2
5185 
5186 
5208 #define DC_PROVIDER_STATUS_OK 1
5209 
5221 #define DC_PROVIDER_STATUS_PREPARATION 2
5222 
5235 #define DC_PROVIDER_STATUS_BROKEN 3
5236 
5257 #define DC_CHAT_VISIBILITY_NORMAL 0
5258 
5271 #define DC_CHAT_VISIBILITY_ARCHIVED 1
5272 
5277 #define DC_CHAT_VISIBILITY_PINNED 2
5278 
5303 #define DC_STR_NOMESSAGES 1
5307 
5311 #define DC_STR_SELF 2
5312 
5316 #define DC_STR_DRAFT 3
5317 
5321 #define DC_STR_VOICEMESSAGE 7
5322 
5326 #define DC_STR_IMAGE 9
5327 
5331 #define DC_STR_VIDEO 10
5332 
5336 #define DC_STR_AUDIO 11
5337 
5341 #define DC_STR_FILE 12
5342 
5347 #define DC_STR_STATUSLINE 13
5348 
5353 #define DC_STR_NEWGROUPDRAFT 14
5354 
5360 #define DC_STR_MSGGRPNAME 15
5361 
5365 #define DC_STR_MSGGRPIMGCHANGED 16
5366 
5371 #define DC_STR_MSGADDMEMBER 17
5372 
5377 #define DC_STR_MSGDELMEMBER 18
5378 
5382 #define DC_STR_MSGGROUPLEFT 19
5383 
5387 #define DC_STR_GIF 23
5388 
5392 #define DC_STR_ENCRYPTEDMSG 24
5393 
5397 #define DC_STR_E2E_AVAILABLE 25
5398 
5400 #define DC_STR_ENCR_TRANSP 27
5401 
5405 #define DC_STR_ENCR_NONE 28
5406 
5410 #define DC_STR_CANTDECRYPT_MSG_BODY 29
5411 
5415 #define DC_STR_FINGERPRINTS 30
5416 
5420 #define DC_STR_READRCPT 31
5421 
5426 #define DC_STR_READRCPT_MAILBODY 32
5427 
5431 #define DC_STR_MSGGRPIMGDELETED 33
5432 
5436 #define DC_STR_E2E_PREFERRED 34
5437 
5442 #define DC_STR_CONTACT_VERIFIED 35
5443 
5448 #define DC_STR_CONTACT_NOT_VERIFIED 36
5449 
5454 #define DC_STR_CONTACT_SETUP_CHANGED 37
5455 
5459 #define DC_STR_ARCHIVEDCHATS 40
5460 
5464 #define DC_STR_AC_SETUP_MSG_SUBJECT 42
5465 
5469 #define DC_STR_AC_SETUP_MSG_BODY 43
5470 
5475 #define DC_STR_CANNOT_LOGIN 60
5476 
5483 #define DC_STR_MSGACTIONBYUSER 62
5484 
5490 #define DC_STR_MSGACTIONBYME 63
5491 
5495 #define DC_STR_MSGLOCATIONENABLED 64
5496 
5500 #define DC_STR_MSGLOCATIONDISABLED 65
5501 
5505 #define DC_STR_LOCATION 66
5506 
5510 #define DC_STR_STICKER 67
5511 
5515 #define DC_STR_DEVICE_MESSAGES 68
5516 
5520 #define DC_STR_SAVED_MESSAGES 69
5521 
5525 #define DC_STR_DEVICE_MESSAGES_HINT 70
5526 
5530 #define DC_STR_WELCOME_MESSAGE 71
5531 
5535 #define DC_STR_UNKNOWN_SENDER_FOR_CHAT 72
5536 
5542 #define DC_STR_SUBJECT_FOR_NEW_CONTACT 73
5543 
5548 #define DC_STR_FAILED_SENDING_TO 74
5549 
5553 #define DC_STR_EPHEMERAL_DISABLED 75
5554 
5560 #define DC_STR_EPHEMERAL_SECONDS 76
5561 
5565 #define DC_STR_EPHEMERAL_MINUTE 77
5566 
5570 #define DC_STR_EPHEMERAL_HOUR 78
5571 
5575 #define DC_STR_EPHEMERAL_DAY 79
5576 
5580 #define DC_STR_EPHEMERAL_WEEK 80
5581 
5583 #define DC_STR_EPHEMERAL_FOUR_WEEKS 81
5584 
5588 #define DC_STR_VIDEOCHAT_INVITATION 82
5589 
5594 #define DC_STR_VIDEOCHAT_INVITE_MSG_BODY 83
5595 
5600 #define DC_STR_CONFIGURATION_FAILED 84
5601 
5606 #define DC_STR_BAD_TIME_MSG_BODY 85
5607 
5611 #define DC_STR_UPDATE_REMINDER_MSG_BODY 86
5612 
5616 #define DC_STR_ERROR_NO_NETWORK 87
5617 
5621 #define DC_STR_PROTECTION_ENABLED 88
5622 
5626 #define DC_STR_PROTECTION_DISABLED 89
5627 
5632 #define DC_STR_REPLY_NOUN 90
5633 
5637 #define DC_STR_SELF_DELETED_MSG_BODY 91
5638 
5642 #define DC_STR_SERVER_TURNED_OFF 92
5643 
5647 //
5649 #define DC_STR_EPHEMERAL_MINUTES 93
5650 
5654 //
5656 #define DC_STR_EPHEMERAL_HOURS 94
5657 
5661 //
5663 #define DC_STR_EPHEMERAL_DAYS 95
5664 
5668 //
5670 #define DC_STR_EPHEMERAL_WEEKS 96
5671 
5675 #define DC_STR_FORWARDED 97
5676 
5682 #ifdef PY_CFFI_INC
5683 /* Helper utility to locate the header file when building python bindings. */
5684 char* _dc_header_file_location(void) {
5685  return __FILE__;
5686 }
5687 #endif
5688 
5689 
5690 #ifdef __cplusplus
5691 }
5692 #endif
5693 #endif // __DELTACHAT_H__
dc_context_t::dc_get_blocked_contacts
dc_array_t * dc_get_blocked_contacts(dc_context_t *context)
Get blocked contacts.
dc_chat_t
dc_msg_t::dc_msg_get_setupcodebegin
char * dc_msg_get_setupcodebegin(const dc_msg_t *msg)
Get the first characters of the setup code.
dc_context_t::dc_get_msg
dc_msg_t * dc_get_msg(dc_context_t *context, uint32_t msg_id)
Get a single message object of the type dc_msg_t.
dc_contact_t::dc_contact_is_blocked
int dc_contact_is_blocked(const dc_contact_t *contact)
Check if a contact is blocked.
dc_context_t::dc_is_sending_locations_to_chat
int dc_is_sending_locations_to_chat(dc_context_t *context, uint32_t chat_id)
Check if location streaming is enabled.
dc_msg_t::dc_msg_set_text
void dc_msg_set_text(dc_msg_t *msg, const char *text)
Set the text of a message object.
dc_context_t::dc_get_securejoin_qr
char * dc_get_securejoin_qr(dc_context_t *context, uint32_t chat_id)
Get QR code text that will offer an Setup-Contact or Verified-Group invitation.
dc_context_t::dc_add_device_msg
uint32_t dc_add_device_msg(dc_context_t *context, const char *label, dc_msg_t *msg)
Add a message to the device-chat.
dc_context_t::dc_send_videochat_invitation
uint32_t dc_send_videochat_invitation(dc_context_t *context, uint32_t chat_id)
Send invitation to a videochat.
dc_context_t::dc_marknoticed_chat
void dc_marknoticed_chat(dc_context_t *context, uint32_t chat_id)
Mark all messages in a chat as noticed.
dc_chat_t::dc_chat_is_self_talk
int dc_chat_is_self_talk(const dc_chat_t *chat)
Check if a chat is a self talk.
dc_chat_t::dc_chat_get_visibility
int dc_chat_get_visibility(const dc_chat_t *chat)
Get visibility of chat.
dc_context_t::dc_stop_ongoing_process
void dc_stop_ongoing_process(dc_context_t *context)
Signal an ongoing process to stop.
dc_msg_t::dc_msg_get_timestamp
int64_t dc_msg_get_timestamp(const dc_msg_t *msg)
Get message sending time.
dc_context_t::dc_send_msg
uint32_t dc_send_msg(dc_context_t *context, uint32_t chat_id, dc_msg_t *msg)
Send a message defined by a dc_msg_t object to a chat.
dc_chatlist_t
dc_accounts_t::dc_accounts_maybe_network
void dc_accounts_maybe_network(dc_accounts_t *accounts)
This function should be called when there is a hint that the network is available again.
dc_msg_t::dc_msg_get_duration
int dc_msg_get_duration(const dc_msg_t *msg)
Get the duration of audio or video.
dc_accounts_t::dc_accounts_migrate_account
uint32_t dc_accounts_migrate_account(dc_accounts_t *accounts, const char *dbfile)
Migrate independent accounts into accounts managed by the account manager.
dc_chat_t::dc_chat_get_profile_image
char * dc_chat_get_profile_image(const dc_chat_t *chat)
Get the chat's profile image.
dc_context_t::dc_add_address_book
int dc_add_address_book(dc_context_t *context, const char *addr_book)
Add a number of contacts.
dc_msg_t::dc_msg_has_html
int dc_msg_has_html(dc_msg_t *msg)
Checks if the message has a full HTML version.
dc_provider_t::dc_provider_new_from_email
dc_provider_t * dc_provider_new_from_email(const dc_context_t *context, const char *email)
Create a provider struct for the given email address.
dc_contact_t::dc_contact_get_auth_name
char * dc_contact_get_auth_name(const dc_contact_t *contact)
Get original contact name.
dc_provider_t::dc_provider_get_before_login_hint
char * dc_provider_get_before_login_hint(const dc_provider_t *provider)
Get hints to be shown to the user on the login screen.
dc_chatlist_t::dc_chatlist_unref
void dc_chatlist_unref(dc_chatlist_t *chatlist)
Free a chatlist object.
dc_array_t::dc_array_get_marker
char * dc_array_get_marker(const dc_array_t *array, size_t index)
Return the marker-character of the item at the given index.
dc_array_t::dc_array_get_chat_id
uint32_t dc_array_get_chat_id(const dc_array_t *array, size_t index)
Return the chat-id of the item at the given index.
dc_context_t::dc_context_unref
void dc_context_unref(dc_context_t *context)
Free a context object.
dc_chat_t::dc_chat_get_type
int dc_chat_get_type(const dc_chat_t *chat)
Get chat type.
dc_contact_t::dc_contact_is_verified
int dc_contact_is_verified(dc_contact_t *contact)
Check if a contact was verified.
dc_context_t::dc_get_chat_media
dc_array_t * dc_get_chat_media(dc_context_t *context, uint32_t chat_id, int msg_type, int msg_type2, int msg_type3)
Returns all message IDs of the given types in a chat.
dc_msg_t::dc_msg_get_sort_timestamp
int64_t dc_msg_get_sort_timestamp(const dc_msg_t *msg)
Get message time used for sorting.
dc_context_t::dc_set_config_from_qr
int dc_set_config_from_qr(dc_context_t *context, const char *qr)
Set configuration values from a QR code.
dc_chat_t::dc_chat_is_device_talk
int dc_chat_is_device_talk(const dc_chat_t *chat)
Check if a chat is a device-talk.
dc_msg_t::dc_msg_set_file
void dc_msg_set_file(dc_msg_t *msg, const char *file, const char *filemime)
Set the file associated with a message object.
dc_context_t::dc_context_new
dc_context_t * dc_context_new(const char *os_name, const char *dbfile, const char *blobdir)
Create a new context object.
dc_context_t::dc_create_chat_by_contact_id
uint32_t dc_create_chat_by_contact_id(dc_context_t *context, uint32_t contact_id)
Create a normal chat with a single user.
dc_context_t::dc_block_contact
void dc_block_contact(dc_context_t *context, uint32_t contact_id, int block)
Block or unblock a contact.
dc_array_t::dc_array_get_contact_id
uint32_t dc_array_get_contact_id(const dc_array_t *array, size_t index)
Return the contact-id of the item at the given index.
dc_context_t::dc_get_contacts
dc_array_t * dc_get_contacts(dc_context_t *context, uint32_t flags, const char *query)
Returns known and unblocked contacts.
dc_context_t::dc_get_mime_headers
char * dc_get_mime_headers(dc_context_t *context, uint32_t msg_id)
Get the raw mime-headers of the given message.
dc_chat_t::dc_chat_is_sending_locations
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().
dc_context_t::dc_set_chat_mute_duration
int dc_set_chat_mute_duration(dc_context_t *context, uint32_t chat_id, int64_t duration)
Set mute duration of a chat.
dc_context_t::dc_get_chat_encrinfo
char * dc_get_chat_encrinfo(dc_context_t *context, uint32_t chat_id)
Get encryption info for a chat.
dc_msg_t::dc_msg_get_viewtype
int dc_msg_get_viewtype(const dc_msg_t *msg)
Get the type of the message.
dc_context_t::dc_get_id
uint32_t dc_get_id(dc_context_t *context)
Get the ID of a context object.
dc_context_t::dc_initiate_key_transfer
char * dc_initiate_key_transfer(dc_context_t *context)
Initiate Autocrypt Setup Transfer.
dc_context_t::dc_get_connectivity_html
char * dc_get_connectivity_html(dc_context_t *context)
Get an overview of the current connectivity, and possibly more statistics.
dc_context_t::dc_start_io
void dc_start_io(dc_context_t *context)
Start job and IMAP/SMTP tasks.
dc_msg_t::dc_msg_get_error
char * dc_msg_get_error(const dc_msg_t *msg)
Gets the error status of the message.
dc_context_t::dc_block_chat
void dc_block_chat(dc_context_t *context, uint32_t chat_id)
Block a chat.
dc_msg_t::dc_msg_get_filemime
char * dc_msg_get_filemime(const dc_msg_t *msg)
Get mime type of the file.
dc_array_t::dc_array_get_longitude
double dc_array_get_longitude(const dc_array_t *array, size_t index)
Return the longitude of the item at the given index.
dc_context_t::dc_preconfigure_keypair
int dc_preconfigure_keypair(dc_context_t *context, const char *addr, const char *public_data, const char *secret_data)
Save a keypair as the default keys for the user.
dc_context_t::dc_is_configured
int dc_is_configured(const dc_context_t *context)
Check if the context is already configured.
dc_lot_t::dc_lot_get_text1_meaning
int dc_lot_get_text1_meaning(const dc_lot_t *lot)
Get the meaning of the first string.
dc_event_t::dc_event_get_account_id
uint32_t dc_event_get_account_id(dc_event_t *event)
Get account-id this event belongs to.
dc_accounts_event_emitter_t::dc_accounts_event_emitter_unref
void dc_accounts_event_emitter_unref(dc_accounts_event_emitter_t *emitter)
Free an accounts event emitter object.
dc_context_t::dc_get_contact
dc_contact_t * dc_get_contact(dc_context_t *context, uint32_t contact_id)
Get a single contact object.
dc_context_t::dc_add_contact_to_chat
int dc_add_contact_to_chat(dc_context_t *context, uint32_t chat_id, uint32_t contact_id)
Add a member to a group.
dc_lot_t
dc_context_t::dc_delete_contact
int dc_delete_contact(dc_context_t *context, uint32_t contact_id)
Delete a contact.
dc_event_emitter_t::dc_event_emitter_unref
void dc_event_emitter_unref(dc_event_emitter_t *emitter)
Free a context event emitter object.
dc_lot_t::dc_lot_get_state
int dc_lot_get_state(const dc_lot_t *lot)
Get the associated state.
dc_context_t::dc_delete_all_locations
void dc_delete_all_locations(dc_context_t *context)
Delete all locations on the current device.
dc_context_t::dc_get_fresh_msgs
dc_array_t * dc_get_fresh_msgs(dc_context_t *context)
Returns the message IDs of all fresh messages of any chat.
dc_msg_t::dc_msg_get_videochat_type
int dc_msg_get_videochat_type(const dc_msg_t *msg)
Get type of videochat.
dc_context_t::dc_estimate_deletion_cnt
int dc_estimate_deletion_cnt(dc_context_t *context, int from_server, int64_t seconds)
Estimate the number of messages that will be deleted by the dc_set_config()-options delete_device_aft...
dc_context_t::dc_get_locations
dc_array_t * dc_get_locations(dc_context_t *context, uint32_t chat_id, uint32_t contact_id, int64_t timestamp_begin, int64_t timestamp_end)
Get shared locations from the database.
dc_context_t::dc_check_qr
dc_lot_t * dc_check_qr(dc_context_t *context, const char *qr)
Check a scanned QR code.
dc_msg_t::dc_msg_is_info
int dc_msg_is_info(const dc_msg_t *msg)
Check if the message is an informational message, created by the device or by another users.
dc_msg_t::dc_msg_latefiling_mediasize
void dc_msg_latefiling_mediasize(dc_msg_t *msg, int width, int height, int duration)
Late filing information to a message.
dc_chat_t::dc_chat_get_name
char * dc_chat_get_name(const dc_chat_t *chat)
Get name of a chat.
dc_msg_t::dc_msg_get_videochat_url
char * dc_msg_get_videochat_url(const dc_msg_t *msg)
Get url of a videochat invitation.
dc_context_t::dc_chatlist_get_summary2
dc_lot_t * dc_chatlist_get_summary2(dc_context_t *context, uint32_t chat_id, uint32_t msg_id)
Create a chatlist summary item when the chatlist object is already unref()'d.
dc_chat_t::dc_chat_unref
void dc_chat_unref(dc_chat_t *chat)
Free a chat object.
dc_msg_t::dc_msg_set_dimension
void dc_msg_set_dimension(dc_msg_t *msg, int width, int height)
Set the dimensions associated with message object.
dc_msg_t::dc_msg_get_from_id
uint32_t dc_msg_get_from_id(const dc_msg_t *msg)
Get the ID of contact who wrote the message.
dc_context_t::dc_create_group_chat
uint32_t dc_create_group_chat(dc_context_t *context, int protect, const char *name)
Create a new group chat.
dc_accounts_event_emitter_t
dc_context_t::dc_get_info
char * dc_get_info(const dc_context_t *context)
Get information about the context.
dc_msg_t::dc_msg_get_width
int dc_msg_get_width(const dc_msg_t *msg)
Get width of image or video.
dc_msg_t::dc_msg_get_chat_id
uint32_t dc_msg_get_chat_id(const dc_msg_t *msg)
Get the ID of chat the message belongs to.
dc_array_t::dc_array_get_msg_id
uint32_t dc_array_get_msg_id(const dc_array_t *array, size_t index)
Return the message-id of the item at the given index.
dc_event_t::dc_event_get_data2_int
int dc_event_get_data2_int(dc_event_t *event)
Get a data associated with an event object.
dc_msg_t::dc_msg_get_ephemeral_timer
uint32_t dc_msg_get_ephemeral_timer(const dc_msg_t *msg)
Get ephemeral timer duration for message.
dc_context_t::dc_set_draft
void dc_set_draft(dc_context_t *context, uint32_t chat_id, dc_msg_t *msg)
Save a draft for a chat in the database.
dc_context_t::dc_get_chat_msgs
dc_array_t * dc_get_chat_msgs(dc_context_t *context, uint32_t chat_id, uint32_t flags, uint32_t marker1before)
Get all message IDs belonging to a chat.
dc_contact_t::dc_contact_get_addr
char * dc_contact_get_addr(const dc_contact_t *contact)
Get email address.
dc_array_t
dc_accounts_t::dc_accounts_new
dc_accounts_t * dc_accounts_new(const char *os_name, const char *dir)
Create a new account manager.
dc_context_t::dc_str_unref
void dc_str_unref(char *str)
Release a string returned by another deltachat-core function.
dc_context_t::dc_get_chat_ephemeral_timer
uint32_t dc_get_chat_ephemeral_timer(dc_context_t *context, uint32_t chat_id)
Get the chat's ephemeral message timer.
dc_accounts_t::dc_accounts_maybe_network_lost
void dc_accounts_maybe_network_lost(dc_accounts_t *accounts)
This function can be called when there is a hint that the network is lost.
dc_context_t::dc_set_stock_translation
int dc_set_stock_translation(dc_context_t *context, uint32_t stock_id, const char *stock_msg)
Set stock string translation.
dc_msg_t::dc_msg_get_height
int dc_msg_get_height(const dc_msg_t *msg)
Get height of image or video.
dc_msg_t::dc_msg_set_override_sender_name
void dc_msg_set_override_sender_name(dc_msg_t *msg, const char *name)
Set different sender name for a message.
dc_accounts_t::dc_accounts_add_account
uint32_t dc_accounts_add_account(dc_accounts_t *accounts)
Add a new account to the account manager.
dc_array_t::dc_array_get_timestamp
int64_t dc_array_get_timestamp(const dc_array_t *array, size_t index)
Return the timestamp of the item at the given index.
dc_context_t::dc_get_event_emitter
dc_event_emitter_t * dc_get_event_emitter(dc_context_t *context)
Create the event emitter that is used to receive events.
dc_contact_t::dc_contact_get_color
uint32_t dc_contact_get_color(const dc_contact_t *contact)
Get a color for the contact.
dc_lot_t::dc_lot_get_text2
char * dc_lot_get_text2(const dc_lot_t *lot)
Get second string.
dc_context_t::dc_prepare_msg
uint32_t dc_prepare_msg(dc_context_t *context, uint32_t chat_id, dc_msg_t *msg)
Prepare a message for sending.
dc_msg_t::dc_msg_set_location
void dc_msg_set_location(dc_msg_t *msg, double latitude, double longitude)
Set any location that should be bound to the message object.
dc_context_t::dc_get_next_media
uint32_t dc_get_next_media(dc_context_t *context, uint32_t msg_id, int dir, int msg_type, int msg_type2, int msg_type3)
Search next/previous message based on a given message and a list of types.
dc_context_t::dc_imex_has_backup
char * dc_imex_has_backup(dc_context_t *context, const char *dir)
Check if there is a backup file.
dc_accounts_t::dc_accounts_unref
void dc_accounts_unref(dc_accounts_t *accounts)
Free an account manager object.
dc_msg_t::dc_msg_unref
void dc_msg_unref(dc_msg_t *msg)
Free a message object.
dc_msg_t::dc_msg_get_filebytes
uint64_t dc_msg_get_filebytes(const dc_msg_t *msg)
Get the size of the file.
dc_context_t::dc_get_msg_cnt
int dc_get_msg_cnt(dc_context_t *context, uint32_t chat_id)
Get the total number of messages in a chat.
dc_array_t::dc_array_get_id
uint32_t dc_array_get_id(const dc_array_t *array, size_t index)
Get the item at the given index as an ID.
dc_contact_t::dc_contact_get_status
char * dc_contact_get_status(const dc_contact_t *contact)
Get the contact's status.
dc_context_t::dc_get_contact_encrinfo
char * dc_get_contact_encrinfo(dc_context_t *context, uint32_t contact_id)
Get encryption info for a contact.
dc_chat_t::dc_chat_is_unpromoted
int dc_chat_is_unpromoted(const dc_chat_t *chat)
Check if a group chat is still unpromoted.
dc_context_t::dc_imex
void dc_imex(dc_context_t *context, int what, const char *param1, const char *param2)
Import/export things.
dc_context_t::dc_continue_key_transfer
int dc_continue_key_transfer(dc_context_t *context, uint32_t msg_id, const char *setup_code)
Continue the Autocrypt Key Transfer on another device.
dc_array_t::dc_array_get_accuracy
double dc_array_get_accuracy(const dc_array_t *array, size_t index)
Return the accuracy of the item at the given index.
dc_context_t::dc_remove_contact_from_chat
int dc_remove_contact_from_chat(dc_context_t *context, uint32_t chat_id, uint32_t contact_id)
Remove a member from a group.
dc_msg_t::dc_msg_get_file
char * dc_msg_get_file(const dc_msg_t *msg)
Find out full path, file name and extension of the file associated with a message.
dc_context_t::dc_set_chat_name
int dc_set_chat_name(dc_context_t *context, uint32_t chat_id, const char *name)
Set group name.
dc_chatlist_t::dc_chatlist_get_msg_id
uint32_t dc_chatlist_get_msg_id(const dc_chatlist_t *chatlist, size_t index)
Get a single message ID of a chatlist.
dc_accounts_t
dc_contact_t::dc_contact_unref
void dc_contact_unref(dc_contact_t *contact)
Free a contact object.
dc_msg_t::dc_msg_has_deviating_timestamp
int dc_msg_has_deviating_timestamp(const dc_msg_t *msg)
Check if a message has a deviating timestamp.
dc_chat_t::dc_chat_is_muted
int dc_chat_is_muted(const dc_chat_t *chat)
Check whether the chat is currently muted (can be changed by dc_set_chat_mute_duration()).
dc_msg_t::dc_msg_get_summarytext
char * dc_msg_get_summarytext(const dc_msg_t *msg, int approx_characters)
Get a message summary as a single line of text.
dc_event_t
dc_context_t::dc_set_chat_profile_image
int dc_set_chat_profile_image(dc_context_t *context, uint32_t chat_id, const char *image)
Set group profile image.
dc_array_t::dc_array_is_independent
int dc_array_is_independent(const dc_array_t *array, size_t index)
Return the independent-state of the location at the given index.
dc_chat_t::dc_chat_get_id
uint32_t dc_chat_get_id(const dc_chat_t *chat)
Get chat ID.
dc_chatlist_t::dc_chatlist_get_chat_id
uint32_t dc_chatlist_get_chat_id(const dc_chatlist_t *chatlist, size_t index)
Get a single chat ID of a chatlist.
dc_context_t::dc_was_device_msg_ever_added
int dc_was_device_msg_ever_added(dc_context_t *context, const char *label)
Check if a device-message with a given label was ever added.
dc_contact_t::dc_contact_get_name
char * dc_contact_get_name(const dc_contact_t *contact)
Get the edited contact name.
dc_context_t::dc_get_chat_contacts
dc_array_t * dc_get_chat_contacts(dc_context_t *context, uint32_t chat_id)
Get contact IDs belonging to a chat.
dc_accounts_t::dc_accounts_select_account
int dc_accounts_select_account(dc_accounts_t *accounts, uint32_t account_id)
Change the selected account.
dc_context_t::dc_may_be_valid_addr
int dc_may_be_valid_addr(const char *addr)
Rough check if a string may be a valid e-mail address.
dc_accounts_t::dc_accounts_get_selected_account
dc_context_t * dc_accounts_get_selected_account(dc_accounts_t *accounts)
Get the currently selected account.
dc_context_t
dc_chat_t::dc_chat_is_protected
int dc_chat_is_protected(const dc_chat_t *chat)
Check if a chat is protected.
dc_contact_t
dc_msg_t::dc_msg_get_received_timestamp
int64_t dc_msg_get_received_timestamp(const dc_msg_t *msg)
Get message receive time.
dc_accounts_t::dc_accounts_get_account
dc_context_t * dc_accounts_get_account(dc_accounts_t *accounts, uint32_t account_id)
Get an account-context from an account-id.
dc_context_t::dc_get_chat
dc_chat_t * dc_get_chat(dc_context_t *context, uint32_t chat_id)
Get chat object by a chat ID.
dc_context_t::dc_get_oauth2_url
char * dc_get_oauth2_url(dc_context_t *context, const char *addr, const char *redirect_uri)
Get url that can be used to initiate an OAuth2 authorisation.
dc_accounts_event_emitter_t::dc_accounts_get_next_event
dc_event_t * dc_accounts_get_next_event(dc_accounts_event_emitter_t *emitter)
Get the next event from an accounts event emitter object.
dc_provider_t::dc_provider_unref
void dc_provider_unref(dc_provider_t *provider)
Free the provider info struct.
dc_provider_t
dc_context_t::dc_is_contact_in_chat
int dc_is_contact_in_chat(dc_context_t *context, uint32_t chat_id, uint32_t contact_id)
Check if a given contact ID is a member of a group chat.
dc_context_t::dc_send_locations_to_chat
void dc_send_locations_to_chat(dc_context_t *context, uint32_t chat_id, int seconds)
Enable or disable location streaming for a chat.
dc_event_t::dc_event_get_id
int dc_event_get_id(dc_event_t *event)
Get the event-id from an event object.
dc_chatlist_t::dc_chatlist_get_context
dc_context_t * dc_chatlist_get_context(dc_chatlist_t *chatlist)
Helper function to get the associated context object.
dc_context_t::dc_configure
void dc_configure(dc_context_t *context)
Configure a context.
dc_msg_t::dc_msg_is_increation
int dc_msg_is_increation(const dc_msg_t *msg)
Check if a message is still in creation.
dc_context_t::dc_join_securejoin
uint32_t dc_join_securejoin(dc_context_t *context, const char *qr)
Continue a Setup-Contact or Verified-Group-Invite protocol started on another device with dc_get_secu...
dc_context_t::dc_set_chat_visibility
void dc_set_chat_visibility(dc_context_t *context, uint32_t chat_id, int visibility)
Set chat visibility to pinned, archived or normal.
dc_event_emitter_t::dc_get_next_event
dc_event_t * dc_get_next_event(dc_event_emitter_t *emitter)
Get the next event from a context event emitter object.
dc_context_t::dc_send_msg_sync
uint32_t dc_send_msg_sync(dc_context_t *context, uint32_t chat_id, dc_msg_t *msg)
Send a message defined by a dc_msg_t object to a chat, synchronously.
dc_lot_t::dc_lot_get_id
uint32_t dc_lot_get_id(const dc_lot_t *lot)
Get the associated ID.
dc_accounts_t::dc_accounts_get_all
dc_array_t * dc_accounts_get_all(dc_accounts_t *accounts)
List all accounts.
dc_context_t::dc_send_text_msg
uint32_t dc_send_text_msg(dc_context_t *context, uint32_t chat_id, const char *text_to_send)
Send a simple text message a given chat.
dc_msg_t::dc_msg_is_bot
int dc_msg_is_bot(const dc_msg_t *msg)
Check if incoming message is a bot message, i.e.
dc_context_t::dc_get_blobdir
char * dc_get_blobdir(const dc_context_t *context)
Get the blob directory.
dc_chat_t::dc_chat_get_remaining_mute_duration
int64_t dc_chat_get_remaining_mute_duration(const dc_chat_t *chat)
Get the exact state of the mute of a chat.
dc_context_t::dc_accept_chat
void dc_accept_chat(dc_context_t *context, uint32_t chat_id)
Accept a contact request chat.
dc_contact_t::dc_contact_get_id
uint32_t dc_contact_get_id(const dc_contact_t *contact)
Get the ID of the contact.
dc_lot_t::dc_lot_unref
void dc_lot_unref(dc_lot_t *lot)
Frees an object containing a set of parameters.
dc_msg_t::dc_msg_is_setupmessage
int dc_msg_is_setupmessage(const dc_msg_t *msg)
Check if the message is an Autocrypt Setup Message.
dc_context_t::dc_create_contact
uint32_t dc_create_contact(dc_context_t *context, const char *name, const char *addr)
Add a single contact as a result of an explicit user action.
dc_accounts_t::dc_accounts_remove_account
int dc_accounts_remove_account(dc_accounts_t *accounts, uint32_t account_id)
Remove an account from the account manager.
dc_chatlist_t::dc_chatlist_get_summary
dc_lot_t * dc_chatlist_get_summary(const dc_chatlist_t *chatlist, size_t index, dc_chat_t *chat)
Get a summary for a chatlist index.
dc_array_t::dc_array_get_cnt
size_t dc_array_get_cnt(const dc_array_t *array)
Find out the number of items in an array.
dc_event_t::dc_event_get_data1_int
int dc_event_get_data1_int(dc_event_t *event)
Get a data associated with an event object.
dc_msg_t
dc_context_t::dc_get_connectivity
int dc_get_connectivity(dc_context_t *context)
Get the current connectivity, i.e.
dc_msg_t::dc_msg_get_state
int dc_msg_get_state(const dc_msg_t *msg)
Get the state of a message.
dc_msg_t::dc_msg_set_html
void dc_msg_set_html(dc_msg_t *msg, const char *html)
Set the HTML part of a message object.
dc_contact_t::dc_contact_get_display_name
char * dc_contact_get_display_name(const dc_contact_t *contact)
Get display name.
dc_context_t::dc_get_msg_info
char * dc_get_msg_info(dc_context_t *context, uint32_t msg_id)
Get an informational text for a single message.
dc_msg_t::dc_msg_get_filename
char * dc_msg_get_filename(const dc_msg_t *msg)
Get base file name without path.
dc_context_t::dc_set_chat_protection
int dc_set_chat_protection(dc_context_t *context, uint32_t chat_id, int protect)
Enable or disable protection against active attacks.
dc_accounts_t::dc_accounts_start_io
void dc_accounts_start_io(dc_accounts_t *accounts)
Start job and IMAP/SMTP tasks for all accounts managed by the account manager.
dc_context_t::dc_get_chat_id_by_contact_id
uint32_t dc_get_chat_id_by_contact_id(dc_context_t *context, uint32_t contact_id)
Check, if there is a normal chat with a given contact.
dc_msg_t::dc_msg_get_summary
dc_lot_t * dc_msg_get_summary(const dc_msg_t *msg, const dc_chat_t *chat)
Get a summary for a message.
dc_accounts_t::dc_accounts_stop_io
void dc_accounts_stop_io(dc_accounts_t *accounts)
Stop job and IMAP/SMTP tasks for all accounts and return when they are finished.
dc_msg_t::dc_msg_is_forwarded
int dc_msg_is_forwarded(const dc_msg_t *msg)
Check if the message is a forwarded message.
dc_context_t::dc_markseen_msgs
void dc_markseen_msgs(dc_context_t *context, const uint32_t *msg_ids, int msg_cnt)
Mark messages as presented to the user.
dc_msg_t::dc_msg_get_override_sender_name
char * dc_msg_get_override_sender_name(const dc_msg_t *msg)
Get the name that should be shown over the message (in a group chat) instead of the contact display n...
dc_msg_t::dc_msg_has_location
int dc_msg_has_location(const dc_msg_t *msg)
Check if a message has a location bound to it.
dc_context_t::dc_forward_msgs
void dc_forward_msgs(dc_context_t *context, const uint32_t *msg_ids, int msg_cnt, uint32_t chat_id)
Forward messages to another chat.
dc_msg_t::dc_msg_get_ephemeral_timestamp
int64_t dc_msg_get_ephemeral_timestamp(const dc_msg_t *msg)
Get timestamp of ephemeral message removal.
dc_accounts_t::dc_accounts_all_work_done
int dc_accounts_all_work_done(dc_accounts_t *accounts)
This is meant especially for iOS, because iOS needs to tell the system when its background work is do...
dc_msg_t::dc_msg_get_quoted_text
char * dc_msg_get_quoted_text(const dc_msg_t *msg)
Get quoted text, if any.
dc_context_t::dc_delete_chat
void dc_delete_chat(dc_context_t *context, uint32_t chat_id)
Delete a chat.
dc_contact_t::dc_contact_get_name_n_addr
char * dc_contact_get_name_n_addr(const dc_contact_t *contact)
Get a summary of name and address.
dc_event_emitter_t
dc_msg_t::dc_msg_get_id
uint32_t dc_msg_get_id(const dc_msg_t *msg)
Get the ID of the message.
dc_accounts_t::dc_accounts_get_event_emitter
dc_accounts_event_emitter_t * dc_accounts_get_event_emitter(dc_accounts_t *accounts)
Create the event emitter that is used to receive events.
dc_contact_t::dc_contact_get_profile_image
char * dc_contact_get_profile_image(const dc_contact_t *contact)
Get the contact's profile image.
dc_msg_t::dc_msg_get_subject
char * dc_msg_get_subject(const dc_msg_t *msg)
Get the subject of the email.
dc_context_t::dc_set_location
int dc_set_location(dc_context_t *context, double latitude, double longitude, double accuracy)
Set current location.
dc_chat_t::dc_chat_can_send
int dc_chat_can_send(const dc_chat_t *chat)
Check if messages can be sent to a given chat.
dc_msg_t::dc_msg_is_sent
int dc_msg_is_sent(const dc_msg_t *msg)
Check if a message was sent successfully.
dc_provider_t::dc_provider_get_status
int dc_provider_get_status(const dc_provider_t *provider)
Whether DC works with this provider.
dc_msg_t::dc_msg_get_info_type
int dc_msg_get_info_type(const dc_msg_t *msg)
Get the type of an informational message.
dc_msg_t::dc_msg_get_showpadlock
int dc_msg_get_showpadlock(const dc_msg_t *msg)
Check if a padlock should be shown beside the message.
dc_context_t::dc_get_blocked_cnt
int dc_get_blocked_cnt(dc_context_t *context)
Get the number of blocked contacts.
dc_msg_t::dc_msg_set_duration
void dc_msg_set_duration(dc_msg_t *msg, int duration)
Set the duration associated with message object.
dc_context_t::dc_get_draft
dc_msg_t * dc_get_draft(dc_context_t *context, uint32_t chat_id)
Get draft for a chat, if any.
dc_context_t::dc_maybe_network
void dc_maybe_network(dc_context_t *context)
This function should be called when there is a hint that the network is available again,...
dc_event_t::dc_event_unref
void dc_event_unref(dc_event_t *event)
Free memory used by an event object.
dc_context_t::dc_stop_io
void dc_stop_io(dc_context_t *context)
Stop job, IMAP, SMTP and other tasks and return when they are finished.
dc_context_t::dc_get_fresh_msg_cnt
int dc_get_fresh_msg_cnt(dc_context_t *context, uint32_t chat_id)
Get the number of fresh messages in a chat.
dc_context_t::dc_delete_msgs
void dc_delete_msgs(dc_context_t *context, const uint32_t *msg_ids, int msg_cnt)
Delete messages.
dc_provider_t::dc_provider_get_overview_page
char * dc_provider_get_overview_page(const dc_provider_t *provider)
URL of the overview page.
dc_chatlist_t::dc_chatlist_get_cnt
size_t dc_chatlist_get_cnt(const dc_chatlist_t *chatlist)
Find out the number of chats in a chatlist.
dc_lot_t::dc_lot_get_text1
char * dc_lot_get_text1(const dc_lot_t *lot)
Get first string.
dc_context_t::dc_lookup_contact_id_by_addr
uint32_t dc_lookup_contact_id_by_addr(dc_context_t *context, const char *addr)
Check if an e-mail address belongs to a known and unblocked contact.
dc_chat_t::dc_chat_is_contact_request
int dc_chat_is_contact_request(const dc_chat_t *chat)
Check if a chat is a contact request chat.
dc_context_t::dc_search_msgs
dc_array_t * dc_search_msgs(dc_context_t *context, uint32_t chat_id, const char *query)
Search messages containing the given query string.
dc_event_t::dc_event_get_data2_str
char * dc_event_get_data2_str(dc_event_t *event)
Get a data associated with an event object.
dc_context_t::dc_get_msg_html
char * dc_get_msg_html(dc_context_t *context, uint32_t msg_id)
Get uncut message, if available.
dc_context_t::dc_get_config
char * dc_get_config(dc_context_t *context, const char *key)
Get a configuration option.
dc_context_t::dc_set_chat_ephemeral_timer
int dc_set_chat_ephemeral_timer(dc_context_t *context, uint32_t chat_id, uint32_t timer)
Set the chat's ephemeral message timer.
dc_msg_t::dc_msg_new
dc_msg_t * dc_msg_new(dc_context_t *context, int viewtype)
Create new message object.
dc_chat_t::dc_chat_get_color
uint32_t dc_chat_get_color(const dc_chat_t *chat)
Get a color for the chat.
dc_context_t::dc_get_chatlist
dc_chatlist_t * dc_get_chatlist(dc_context_t *context, int flags, const char *query_str, uint32_t query_id)
Get a list of chats.
dc_context_t::dc_set_config
int dc_set_config(dc_context_t *context, const char *key, const char *value)
Configure the context.
dc_array_t::dc_array_get_latitude
double dc_array_get_latitude(const dc_array_t *array, size_t index)
Return the latitude of the item at the given index.
dc_array_t::dc_array_unref
void dc_array_unref(dc_array_t *array)
Free an array object.
dc_msg_t::dc_msg_set_quote
void dc_msg_set_quote(dc_msg_t *msg, const dc_msg_t *quote)
Set the message replying to.
dc_lot_t::dc_lot_get_timestamp
int64_t dc_lot_get_timestamp(const dc_lot_t *lot)
Get the associated timestamp.
dc_msg_t::dc_msg_get_text
char * dc_msg_get_text(const dc_msg_t *msg)
Get the text of the message.
dc_msg_t::dc_msg_get_quoted_msg
dc_msg_t * dc_msg_get_quoted_msg(const dc_msg_t *msg)
Get quoted message, if available.