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 
356 int dc_set_config (dc_context_t* context, const char* key, const char* value);
357 
358 
381 char* dc_get_config (dc_context_t* context, const char* key);
382 
383 
395 int dc_set_stock_translation(dc_context_t* context, uint32_t stock_id, const char* stock_msg);
396 
397 
412 int dc_set_config_from_qr (dc_context_t* context, const char* qr);
413 
414 
429 char* dc_get_info (const dc_context_t* context);
430 
431 
461 char* dc_get_oauth2_url (dc_context_t* context, const char* addr, const char* redirect_uri);
462 
463 
464 // connect
465 
515 void dc_configure (dc_context_t* context);
516 
517 
529 int dc_is_configured (const dc_context_t* context);
530 
531 
542 void dc_start_io (dc_context_t* context);
543 
558 void dc_stop_io(dc_context_t* context);
559 
582 void dc_maybe_network (dc_context_t* context);
583 
584 
585 
604 int dc_preconfigure_keypair (dc_context_t* context, const char *addr, const char *public_data, const char *secret_data);
605 
606 
607 // handle chatlists
608 
609 #define DC_GCL_ARCHIVED_ONLY 0x01
610 #define DC_GCL_NO_SPECIALS 0x02
611 #define DC_GCL_ADD_ALLDONE_HINT 0x04
612 #define DC_GCL_FOR_FORWARDING 0x08
613 
614 
669 dc_chatlist_t* dc_get_chatlist (dc_context_t* context, int flags, const char* query_str, uint32_t query_id);
670 
671 
672 // handle chats
673 
700 uint32_t dc_create_chat_by_msg_id (dc_context_t* context, uint32_t msg_id);
701 
702 
717 uint32_t dc_create_chat_by_contact_id (dc_context_t* context, uint32_t contact_id);
718 
719 
731 uint32_t dc_get_chat_id_by_contact_id (dc_context_t* context, uint32_t contact_id);
732 
733 
779 uint32_t dc_prepare_msg (dc_context_t* context, uint32_t chat_id, dc_msg_t* msg);
780 
781 
819 uint32_t dc_send_msg (dc_context_t* context, uint32_t chat_id, dc_msg_t* msg);
820 
836 uint32_t dc_send_msg_sync (dc_context_t* context, uint32_t chat_id, dc_msg_t* msg);
837 
838 
858 uint32_t dc_send_text_msg (dc_context_t* context, uint32_t chat_id, const char* text_to_send);
859 
860 
894 uint32_t dc_send_videochat_invitation (dc_context_t* context, uint32_t chat_id);
895 
896 
922 void dc_set_draft (dc_context_t* context, uint32_t chat_id, dc_msg_t* msg);
923 
924 
972 uint32_t dc_add_device_msg (dc_context_t* context, const char* label, dc_msg_t* msg);
973 
984 int dc_was_device_msg_ever_added (dc_context_t* context, const char* label);
985 
986 
999 dc_msg_t* dc_get_draft (dc_context_t* context, uint32_t chat_id);
1000 
1001 
1002 #define DC_GCM_ADDDAYMARKER 0x01
1003 #define DC_GCM_INFO_ONLY 0x02
1004 
1005 
1027 dc_array_t* dc_get_chat_msgs (dc_context_t* context, uint32_t chat_id, uint32_t flags, uint32_t marker1before);
1028 
1029 
1038 int dc_get_msg_cnt (dc_context_t* context, uint32_t chat_id);
1039 
1040 
1054 int dc_get_fresh_msg_cnt (dc_context_t* context, uint32_t chat_id);
1055 
1056 
1057 
1072 int dc_estimate_deletion_cnt (dc_context_t* context, int from_server, int64_t seconds);
1073 
1074 
1094 
1095 
1110 void dc_marknoticed_chat (dc_context_t* context, uint32_t chat_id);
1111 
1112 
1130 dc_array_t* dc_get_chat_media (dc_context_t* context, uint32_t chat_id, int msg_type, int msg_type2, int msg_type3);
1131 
1132 
1155 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);
1156 
1157 
1173 int dc_set_chat_protection (dc_context_t* context, uint32_t chat_id, int protect);
1174 
1175 
1187 void dc_set_chat_visibility (dc_context_t* context, uint32_t chat_id, int visibility);
1188 
1189 
1215 void dc_delete_chat (dc_context_t* context, uint32_t chat_id);
1216 
1217 
1240 dc_array_t* dc_get_chat_contacts (dc_context_t* context, uint32_t chat_id);
1241 
1252 char* dc_get_chat_encrinfo (dc_context_t* context, uint32_t chat_id);
1253 
1265 uint32_t dc_get_chat_ephemeral_timer (dc_context_t* context, uint32_t chat_id);
1266 
1290 dc_array_t* dc_search_msgs (dc_context_t* context, uint32_t chat_id, const char* query);
1291 
1292 
1303 dc_chat_t* dc_get_chat (dc_context_t* context, uint32_t chat_id);
1304 
1305 
1306 // handle group chats
1307 
1336 uint32_t dc_create_group_chat (dc_context_t* context, int protect, const char* name);
1337 
1338 
1349 int dc_is_contact_in_chat (dc_context_t* context, uint32_t chat_id, uint32_t contact_id);
1350 
1351 
1368 int dc_add_contact_to_chat (dc_context_t* context, uint32_t chat_id, uint32_t contact_id);
1369 
1370 
1385 int dc_remove_contact_from_chat (dc_context_t* context, uint32_t chat_id, uint32_t contact_id);
1386 
1387 
1402 int dc_set_chat_name (dc_context_t* context, uint32_t chat_id, const char* name);
1403 
1421 int dc_set_chat_ephemeral_timer (dc_context_t* context, uint32_t chat_id, uint32_t timer);
1422 
1442 int dc_set_chat_profile_image (dc_context_t* context, uint32_t chat_id, const char* image);
1443 
1444 
1445 
1467 int dc_set_chat_mute_duration (dc_context_t* context, uint32_t chat_id, int64_t duration);
1468 
1469 // handle messages
1470 
1483 char* dc_get_msg_info (dc_context_t* context, uint32_t msg_id);
1484 
1485 
1533 char* dc_get_msg_html (dc_context_t* context, uint32_t msg_id);
1534 
1535 
1550 char* dc_get_mime_headers (dc_context_t* context, uint32_t msg_id);
1551 
1552 
1562 void dc_delete_msgs (dc_context_t* context, const uint32_t* msg_ids, int msg_cnt);
1563 
1564 
1574 void dc_forward_msgs (dc_context_t* context, const uint32_t* msg_ids, int msg_cnt, uint32_t chat_id);
1575 
1576 
1593 void dc_marknoticed_contact (dc_context_t* context, uint32_t contact_id);
1594 
1595 
1621 void dc_markseen_msgs (dc_context_t* context, const uint32_t* msg_ids, int msg_cnt);
1622 
1623 
1636 dc_msg_t* dc_get_msg (dc_context_t* context, uint32_t msg_id);
1637 
1638 
1639 #define DC_DECISION_START_CHAT 0
1640 #define DC_DECISION_BLOCK 1
1641 #define DC_DECISION_NOT_NOW 2
1642 
1643 
1683 uint32_t dc_decide_on_contact_request (dc_context_t* context, uint32_t msg_id, int decision);
1684 
1685 
1686 // handle contacts
1687 
1701 int dc_may_be_valid_addr (const char* addr);
1702 
1703 
1717 uint32_t dc_lookup_contact_id_by_addr (dc_context_t* context, const char* addr);
1718 
1719 
1740 uint32_t dc_create_contact (dc_context_t* context, const char* name, const char* addr);
1741 
1742 
1743 #define DC_GCL_VERIFIED_ONLY 0x01
1744 #define DC_GCL_ADD_SELF 0x02
1745 
1746 
1770 int dc_add_address_book (dc_context_t* context, const char* addr_book);
1771 
1772 
1789 dc_array_t* dc_get_contacts (dc_context_t* context, uint32_t flags, const char* query);
1790 
1791 
1800 int dc_get_blocked_cnt (dc_context_t* context);
1801 
1802 
1812 
1813 
1823 void dc_block_contact (dc_context_t* context, uint32_t contact_id, int block);
1824 
1825 
1836 char* dc_get_contact_encrinfo (dc_context_t* context, uint32_t contact_id);
1837 
1838 
1850 int dc_delete_contact (dc_context_t* context, uint32_t contact_id);
1851 
1852 
1866 dc_contact_t* dc_get_contact (dc_context_t* context, uint32_t contact_id);
1867 
1868 
1869 // import/export and tools
1870 
1871 #define DC_IMEX_EXPORT_SELF_KEYS 1 // param1 is a directory where the keys are written to
1872 #define DC_IMEX_IMPORT_SELF_KEYS 2 // param1 is a directory where the keys are searched in and read from
1873 #define DC_IMEX_EXPORT_BACKUP 11 // param1 is a directory where the backup is written to
1874 #define DC_IMEX_IMPORT_BACKUP 12 // param1 is the file with the backup to import
1875 
1876 
1919 void dc_imex (dc_context_t* context, int what, const char* param1, const char* param2);
1920 
1921 
1971 char* dc_imex_has_backup (dc_context_t* context, const char* dir);
1972 
1973 
2019 char* dc_initiate_key_transfer (dc_context_t* context);
2020 
2021 
2042 int dc_continue_key_transfer (dc_context_t* context, uint32_t msg_id, const char* setup_code);
2043 
2044 
2061 void dc_stop_ongoing_process (dc_context_t* context);
2062 
2063 
2064 // out-of-band verification
2065 
2066 #define DC_QR_ASK_VERIFYCONTACT 200 // id=contact
2067 #define DC_QR_ASK_VERIFYGROUP 202 // text1=groupname
2068 #define DC_QR_FPR_OK 210 // id=contact
2069 #define DC_QR_FPR_MISMATCH 220 // id=contact
2070 #define DC_QR_FPR_WITHOUT_ADDR 230 // test1=formatted fingerprint
2071 #define DC_QR_ACCOUNT 250 // text1=domain
2072 #define DC_QR_WEBRTC_INSTANCE 260 // text1=domain
2073 #define DC_QR_ADDR 320 // id=contact
2074 #define DC_QR_TEXT 330 // text1=text
2075 #define DC_QR_URL 332 // text1=URL
2076 #define DC_QR_ERROR 400 // text1=error string
2077 
2105 dc_lot_t* dc_check_qr (dc_context_t* context, const char* qr);
2106 
2107 
2129 char* dc_get_securejoin_qr (dc_context_t* context, uint32_t chat_id);
2130 
2131 
2167 uint32_t dc_join_securejoin (dc_context_t* context, const char* qr);
2168 
2169 
2170 // location streaming
2171 
2172 
2189 void dc_send_locations_to_chat (dc_context_t* context, uint32_t chat_id, int seconds);
2190 
2191 
2205 int dc_is_sending_locations_to_chat (dc_context_t* context, uint32_t chat_id);
2206 
2207 
2235 int dc_set_location (dc_context_t* context, double latitude, double longitude, double accuracy);
2236 
2237 
2298 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);
2299 
2300 
2311 void dc_delete_all_locations (dc_context_t* context);
2312 
2313 
2326 void dc_str_unref (char* str);
2327 
2328 
2375 dc_accounts_t* dc_accounts_new (const char* os_name, const char* dir);
2376 
2377 
2384 void dc_accounts_unref (dc_accounts_t* accounts);
2385 
2386 
2402 uint32_t dc_accounts_add_account (dc_accounts_t* accounts);
2403 
2404 
2417 uint32_t dc_accounts_import_account (dc_accounts_t* accounts, const char* tarfile);
2418 
2419 
2434 uint32_t dc_accounts_migrate_account (dc_accounts_t* accounts, const char* dbfile);
2435 
2436 
2448 int dc_accounts_remove_account (dc_accounts_t* accounts, uint32_t account_id);
2449 
2450 
2460 
2461 
2473 dc_context_t* dc_accounts_get_account (dc_accounts_t* accounts, uint32_t account_id);
2474 
2475 
2491 
2492 
2501 int dc_accounts_select_account (dc_accounts_t* accounts, uint32_t account_id);
2502 
2503 
2513 void dc_accounts_start_io (dc_accounts_t* accounts);
2514 
2515 
2524 void dc_accounts_stop_io (dc_accounts_t* accounts);
2525 
2526 
2536 void dc_accounts_maybe_network (dc_accounts_t* accounts);
2537 
2538 
2559 
2560 
2579 void dc_array_unref (dc_array_t* array);
2580 
2581 
2589 size_t dc_array_get_cnt (const dc_array_t* array);
2590 
2591 
2600 uint32_t dc_array_get_id (const dc_array_t* array, size_t index);
2601 
2602 
2612 double dc_array_get_latitude (const dc_array_t* array, size_t index);
2613 
2614 
2624 double dc_array_get_longitude (const dc_array_t* array, size_t index);
2625 
2626 
2637 double dc_array_get_accuracy (const dc_array_t* array, size_t index);
2638 
2639 
2649 int64_t dc_array_get_timestamp (const dc_array_t* array, size_t index);
2650 
2651 
2661 uint32_t dc_array_get_chat_id (const dc_array_t* array, size_t index);
2662 
2663 
2673 uint32_t dc_array_get_contact_id (const dc_array_t* array, size_t index);
2674 
2675 
2685 uint32_t dc_array_get_msg_id (const dc_array_t* array, size_t index);
2686 
2687 
2702 char* dc_array_get_marker (const dc_array_t* array, size_t index);
2703 
2704 
2715 int dc_array_is_independent (const dc_array_t* array, size_t index);
2716 
2717 
2727 int dc_array_search_id (const dc_array_t* array, uint32_t needle, size_t* ret_index);
2728 
2729 
2777 void dc_chatlist_unref (dc_chatlist_t* chatlist);
2778 
2779 
2787 size_t dc_chatlist_get_cnt (const dc_chatlist_t* chatlist);
2788 
2789 
2801 uint32_t dc_chatlist_get_chat_id (const dc_chatlist_t* chatlist, size_t index);
2802 
2803 
2815 uint32_t dc_chatlist_get_msg_id (const dc_chatlist_t* chatlist, size_t index);
2816 
2817 
2844 dc_lot_t* dc_chatlist_get_summary (const dc_chatlist_t* chatlist, size_t index, dc_chat_t* chat);
2845 
2846 
2866 dc_lot_t* dc_chatlist_get_summary2 (dc_context_t* context, uint32_t chat_id, uint32_t msg_id);
2867 
2868 
2877 
2878 
2895 char* dc_chat_get_info_json (dc_context_t* context, size_t chat_id);
2896 
2907 #define DC_CHAT_ID_DEADDROP 1 // virtual chat showing all messages belonging to chats flagged with chats.blocked=2
2908 #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)
2909 #define DC_CHAT_ID_ARCHIVED_LINK 6 // only an indicator in a chatlist
2910 #define DC_CHAT_ID_ALLDONE_HINT 7 // only an indicator in a chatlist
2911 #define DC_CHAT_ID_LAST_SPECIAL 9 // larger chat IDs are "real" chats, their messages are "real" messages.
2912 
2913 
2914 #define DC_CHAT_TYPE_UNDEFINED 0
2915 #define DC_CHAT_TYPE_SINGLE 100
2916 #define DC_CHAT_TYPE_GROUP 120
2917 #define DC_CHAT_TYPE_MAILINGLIST 140
2918 
2919 
2927 void dc_chat_unref (dc_chat_t* chat);
2928 
2929 
2943 uint32_t dc_chat_get_id (const dc_chat_t* chat);
2944 
2945 
2967 int dc_chat_get_type (const dc_chat_t* chat);
2968 
2969 
2981 char* dc_chat_get_name (const dc_chat_t* chat);
2982 
2983 
2997 char* dc_chat_get_profile_image (const dc_chat_t* chat);
2998 
2999 
3012 uint32_t dc_chat_get_color (const dc_chat_t* chat);
3013 
3014 
3023 int dc_chat_get_visibility (const dc_chat_t* chat);
3024 
3025 
3046 int dc_chat_is_unpromoted (const dc_chat_t* chat);
3047 
3048 
3057 int dc_chat_is_self_talk (const dc_chat_t* chat);
3058 
3059 
3074 int dc_chat_is_device_talk (const dc_chat_t* chat);
3075 
3076 
3088 int dc_chat_can_send (const dc_chat_t* chat);
3089 
3090 
3101 int dc_chat_is_protected (const dc_chat_t* chat);
3102 
3103 
3114 int dc_chat_is_sending_locations (const dc_chat_t* chat);
3115 
3116 
3124 int dc_chat_is_muted (const dc_chat_t* chat);
3125 
3126 
3134 int64_t dc_chat_get_remaining_mute_duration (const dc_chat_t* chat);
3135 
3136 
3146 #define DC_MSG_ID_MARKER1 1
3147 #define DC_MSG_ID_DAYMARKER 9
3148 #define DC_MSG_ID_LAST_SPECIAL 9
3149 
3150 
3151 #define DC_STATE_UNDEFINED 0
3152 #define DC_STATE_IN_FRESH 10
3153 #define DC_STATE_IN_NOTICED 13
3154 #define DC_STATE_IN_SEEN 16
3155 #define DC_STATE_OUT_PREPARING 18
3156 #define DC_STATE_OUT_DRAFT 19
3157 #define DC_STATE_OUT_PENDING 20
3158 #define DC_STATE_OUT_FAILED 24
3159 #define DC_STATE_OUT_DELIVERED 26 // to check if a mail was sent, use dc_msg_is_sent()
3160 #define DC_STATE_OUT_MDN_RCVD 28
3161 
3162 
3163 #define DC_MAX_GET_TEXT_LEN 30000 // approx. max. length returned by dc_msg_get_text()
3164 #define DC_MAX_GET_INFO_LEN 100000 // approx. max. length returned by dc_get_msg_info()
3165 
3166 
3179 dc_msg_t* dc_msg_new (dc_context_t* context, int viewtype);
3180 
3181 
3189 void dc_msg_unref (dc_msg_t* msg);
3190 
3191 
3200 uint32_t dc_msg_get_id (const dc_msg_t* msg);
3201 
3202 
3217 uint32_t dc_msg_get_from_id (const dc_msg_t* msg);
3218 
3219 
3231 uint32_t dc_msg_get_chat_id (const dc_msg_t* msg);
3232 
3233 
3244 uint32_t dc_msg_get_real_chat_id (const dc_msg_t* msg);
3245 
3246 
3255 int dc_msg_get_viewtype (const dc_msg_t* msg);
3256 
3257 
3291 int dc_msg_get_state (const dc_msg_t* msg);
3292 
3293 
3310 int64_t dc_msg_get_timestamp (const dc_msg_t* msg);
3311 
3312 
3324 int64_t dc_msg_get_received_timestamp (const dc_msg_t* msg);
3325 
3326 
3340 int64_t dc_msg_get_sort_timestamp (const dc_msg_t* msg);
3341 
3342 
3362 char* dc_msg_get_text (const dc_msg_t* msg);
3363 
3364 
3382 char* dc_msg_get_subject (const dc_msg_t* msg);
3383 
3397 char* dc_msg_get_file (const dc_msg_t* msg);
3398 
3399 
3410 char* dc_msg_get_filename (const dc_msg_t* msg);
3411 
3412 
3423 char* dc_msg_get_filemime (const dc_msg_t* msg);
3424 
3425 
3436 uint64_t dc_msg_get_filebytes (const dc_msg_t* msg);
3437 
3438 
3453 int dc_msg_get_width (const dc_msg_t* msg);
3454 
3455 
3470 int dc_msg_get_height (const dc_msg_t* msg);
3471 
3472 
3484 int dc_msg_get_duration (const dc_msg_t* msg);
3485 
3486 
3494 int dc_msg_get_showpadlock (const dc_msg_t* msg);
3495 
3496 
3508 uint32_t dc_msg_get_ephemeral_timer (const dc_msg_t* msg);
3509 
3522 int64_t dc_msg_get_ephemeral_timestamp (const dc_msg_t* msg);
3523 
3524 
3547 dc_lot_t* dc_msg_get_summary (const dc_msg_t* msg, const dc_chat_t* chat);
3548 
3549 
3561 char* dc_msg_get_summarytext (const dc_msg_t* msg, int approx_characters);
3562 
3563 
3592 char* dc_msg_get_override_sender_name(const dc_msg_t* msg);
3593 
3594 
3595 
3611 
3612 
3622 int dc_msg_has_location (const dc_msg_t* msg);
3623 
3624 
3635 int dc_msg_is_sent (const dc_msg_t* msg);
3636 
3637 
3654 int dc_msg_is_forwarded (const dc_msg_t* msg);
3655 
3656 
3674 int dc_msg_is_info (const dc_msg_t* msg);
3675 
3676 
3695 int dc_msg_get_info_type (const dc_msg_t* msg);
3696 
3697 
3698 // DC_INFO* uses the same values as SystemMessage in rust-land
3699 #define DC_INFO_PROTECTION_ENABLED 11
3700 #define DC_INFO_PROTECTION_DISABLED 12
3701 
3702 
3715 int dc_msg_is_increation (const dc_msg_t* msg);
3716 
3717 
3732 int dc_msg_is_setupmessage (const dc_msg_t* msg);
3733 
3734 
3749 char* dc_msg_get_setupcodebegin (const dc_msg_t* msg);
3750 
3751 
3765 char* dc_msg_get_videochat_url (const dc_msg_t* msg);
3766 
3767 
3787 char* dc_msg_get_error (const dc_msg_t* msg);
3788 
3789 
3818 int dc_msg_get_videochat_type (const dc_msg_t* msg);
3819 
3820 #define DC_VIDEOCHATTYPE_UNKNOWN 0
3821 #define DC_VIDEOCHATTYPE_BASICWEBRTC 1
3822 #define DC_VIDEOCHATTYPE_JITSI 2
3823 
3824 
3848 int dc_msg_has_html (dc_msg_t* msg);
3849 
3850 
3859 void dc_msg_set_text (dc_msg_t* msg, const char* text);
3860 
3861 
3886 void dc_msg_set_html (dc_msg_t* msg, const char* html);
3887 
3888 
3901 void dc_msg_set_override_sender_name(dc_msg_t* msg, const char* name);
3902 
3903 
3916 void dc_msg_set_file (dc_msg_t* msg, const char* file, const char* filemime);
3917 
3918 
3929 void dc_msg_set_dimension (dc_msg_t* msg, int width, int height);
3930 
3931 
3941 void dc_msg_set_duration (dc_msg_t* msg, int duration);
3942 
3943 
3960 void dc_msg_set_location (dc_msg_t* msg, double latitude, double longitude);
3961 
3962 
3984 void dc_msg_latefiling_mediasize (dc_msg_t* msg, int width, int height, int duration);
3985 
3986 
4000 void dc_msg_set_quote (dc_msg_t* msg, const dc_msg_t* quote);
4001 
4002 
4017 char* dc_msg_get_quoted_text (const dc_msg_t* msg);
4018 
4019 
4042 
4043 
4065 #define DC_CONTACT_ID_SELF 1
4066 #define DC_CONTACT_ID_INFO 2 // centered messages as "member added", used in all chats
4067 #define DC_CONTACT_ID_DEVICE 5 // messages "update info" in the device-chat
4068 #define DC_CONTACT_ID_LAST_SPECIAL 9
4069 
4070 
4078 void dc_contact_unref (dc_contact_t* contact);
4079 
4080 
4088 uint32_t dc_contact_get_id (const dc_contact_t* contact);
4089 
4090 
4099 char* dc_contact_get_addr (const dc_contact_t* contact);
4100 
4101 
4116 char* dc_contact_get_name (const dc_contact_t* contact);
4117 
4118 
4138 char* dc_contact_get_auth_name (const dc_contact_t* contact);
4139 
4140 
4156 char* dc_contact_get_display_name (const dc_contact_t* contact);
4157 
4158 
4159 // dc_contact_get_first_name is removed,
4160 // the following define is to make upgrading more smoothly.
4161 #define dc_contact_get_first_name dc_contact_get_display_name
4162 
4163 
4178 char* dc_contact_get_name_n_addr (const dc_contact_t* contact);
4179 
4180 
4192 char* dc_contact_get_profile_image (const dc_contact_t* contact);
4193 
4194 
4206 uint32_t dc_contact_get_color (const dc_contact_t* contact);
4207 
4208 
4220 char* dc_contact_get_status (const dc_contact_t* contact);
4221 
4231 int dc_contact_is_blocked (const dc_contact_t* contact);
4232 
4233 
4245 int dc_contact_is_verified (dc_contact_t* contact);
4246 
4247 
4267 dc_provider_t* dc_provider_new_from_email (const dc_context_t* context, const char* email);
4268 
4269 
4281 char* dc_provider_get_overview_page (const dc_provider_t* provider);
4282 
4283 
4298 char* dc_provider_get_before_login_hint (const dc_provider_t* provider);
4299 
4300 
4311 int dc_provider_get_status (const dc_provider_t* provider);
4312 
4313 
4320 void dc_provider_unref (dc_provider_t* provider);
4321 
4322 
4335 #define DC_TEXT1_DRAFT 1
4336 #define DC_TEXT1_USERNAME 2
4337 #define DC_TEXT1_SELF 3
4338 
4339 
4349 void dc_lot_unref (dc_lot_t* lot);
4350 
4351 
4361 char* dc_lot_get_text1 (const dc_lot_t* lot);
4362 
4363 
4373 char* dc_lot_get_text2 (const dc_lot_t* lot);
4374 
4375 
4385 int dc_lot_get_text1_meaning (const dc_lot_t* lot);
4386 
4387 
4395 int dc_lot_get_state (const dc_lot_t* lot);
4396 
4397 
4405 uint32_t dc_lot_get_id (const dc_lot_t* lot);
4406 
4407 
4417 int64_t dc_lot_get_timestamp (const dc_lot_t* lot);
4418 
4419 
4449 #define DC_MSG_TEXT 10
4450 
4451 
4463 #define DC_MSG_IMAGE 20
4464 
4465 
4471 #define DC_MSG_GIF 21
4472 
4473 
4479 #define DC_MSG_STICKER 23
4480 
4481 
4487 #define DC_MSG_AUDIO 40
4488 
4489 
4496 #define DC_MSG_VOICE 41
4497 
4498 
4507 #define DC_MSG_VIDEO 50
4508 
4509 
4515 #define DC_MSG_FILE 60
4516 
4517 
4526 #define DC_MSG_VIDEOCHAT_INVITATION 70
4527 
4547 #define DC_SOCKET_AUTO 0
4548 
4549 
4553 #define DC_SOCKET_SSL 1
4554 
4555 
4559 #define DC_SOCKET_STARTTLS 2
4560 
4561 
4565 #define DC_SOCKET_PLAIN 3
4566 
4590 #define DC_LP_AUTH_OAUTH2 0x2
4591 
4592 
4597 #define DC_LP_AUTH_NORMAL 0x4
4598 
4599 
4604 #define DC_LP_AUTH_FLAGS (DC_LP_AUTH_OAUTH2|DC_LP_AUTH_NORMAL) // if none of these flags are set, the default is chosen
4605 
4621 #define DC_CERTCK_AUTO 0
4622 
4627 #define DC_CERTCK_STRICT 1
4628 
4633 #define DC_CERTCK_ACCEPT_INVALID_CERTIFICATES 3
4634 
4661 
4662 
4671 
4672 
4694 
4695 
4704 
4705 
4724 int dc_event_get_id(dc_event_t* event);
4725 
4726 
4739 
4740 
4753 
4754 
4767 char* dc_event_get_data2_str(dc_event_t* event);
4768 
4769 
4779 uint32_t dc_event_get_account_id(dc_event_t* event);
4780 
4781 
4789 void dc_event_unref(dc_event_t* event);
4790 
4791 
4814 #define DC_EVENT_INFO 100
4815 
4816 
4823 #define DC_EVENT_SMTP_CONNECTED 101
4824 
4825 
4832 #define DC_EVENT_IMAP_CONNECTED 102
4833 
4840 #define DC_EVENT_SMTP_MESSAGE_SENT 103
4841 
4848 #define DC_EVENT_IMAP_MESSAGE_DELETED 104
4849 
4856 #define DC_EVENT_IMAP_MESSAGE_MOVED 105
4857 
4864 #define DC_EVENT_NEW_BLOB_FILE 150
4865 
4872 #define DC_EVENT_DELETED_BLOB_FILE 151
4873 
4882 #define DC_EVENT_WARNING 300
4883 
4884 
4902 #define DC_EVENT_ERROR 400
4903 
4904 
4922 #define DC_EVENT_ERROR_NETWORK 401
4923 
4924 
4935 #define DC_EVENT_ERROR_SELF_NOT_IN_GROUP 410
4936 
4937 
4948 #define DC_EVENT_MSGS_CHANGED 2000
4949 
4950 
4960 #define DC_EVENT_INCOMING_MSG 2005
4961 
4962 
4975 #define DC_EVENT_MSGS_NOTICED 2008
4976 
4977 
4985 #define DC_EVENT_MSG_DELIVERED 2010
4986 
4987 
4996 #define DC_EVENT_MSG_FAILED 2012
4997 
4998 
5006 #define DC_EVENT_MSG_READ 2015
5007 
5008 
5018 #define DC_EVENT_CHAT_MODIFIED 2020
5019 
5023 #define DC_EVENT_CHAT_EPHEMERAL_TIMER_MODIFIED 2021
5024 
5025 
5032 #define DC_EVENT_CONTACTS_CHANGED 2030
5033 
5034 
5035 
5044 #define DC_EVENT_LOCATION_CHANGED 2035
5045 
5046 
5053 #define DC_EVENT_CONFIGURE_PROGRESS 2041
5054 
5055 
5062 #define DC_EVENT_IMEX_PROGRESS 2051
5063 
5064 
5075 #define DC_EVENT_IMEX_FILE_WRITTEN 2052
5076 
5077 
5092 #define DC_EVENT_SECUREJOIN_INVITER_PROGRESS 2060
5093 
5094 
5107 #define DC_EVENT_SECUREJOIN_JOINER_PROGRESS 2061
5108 
5114 #define DC_EVENT_DATA1_IS_STRING(e) 0 // not used anymore
5115 #define DC_EVENT_DATA2_IS_STRING(e) ((e)==DC_EVENT_CONFIGURE_PROGRESS || (e)==DC_EVENT_IMEX_FILE_WRITTEN || ((e)>=100 && (e)<=499))
5116 
5117 
5118 /*
5119  * Values for dc_get|set_config("show_emails")
5120  */
5121 #define DC_SHOW_EMAILS_OFF 0
5122 #define DC_SHOW_EMAILS_ACCEPTED_CONTACTS 1
5123 #define DC_SHOW_EMAILS_ALL 2
5124 
5125 
5126 /*
5127  * Values for dc_get|set_config("media_quality")
5128  */
5129 #define DC_MEDIA_QUALITY_BALANCED 0
5130 #define DC_MEDIA_QUALITY_WORSE 1
5131 
5132 
5133 /*
5134  * Values for dc_get|set_config("key_gen_type")
5135  */
5136 #define DC_KEY_GEN_DEFAULT 0
5137 #define DC_KEY_GEN_RSA2048 1
5138 #define DC_KEY_GEN_ED25519 2
5139 
5140 
5162 #define DC_PROVIDER_STATUS_OK 1
5163 
5175 #define DC_PROVIDER_STATUS_PREPARATION 2
5176 
5189 #define DC_PROVIDER_STATUS_BROKEN 3
5190 
5211 #define DC_CHAT_VISIBILITY_NORMAL 0
5212 
5225 #define DC_CHAT_VISIBILITY_ARCHIVED 1
5226 
5231 #define DC_CHAT_VISIBILITY_PINNED 2
5232 
5257 #define DC_STR_NOMESSAGES 1
5261 
5265 #define DC_STR_SELF 2
5266 
5270 #define DC_STR_DRAFT 3
5271 
5275 #define DC_STR_VOICEMESSAGE 7
5276 
5280 #define DC_STR_DEADDROP 8
5281 
5285 #define DC_STR_IMAGE 9
5286 
5290 #define DC_STR_VIDEO 10
5291 
5295 #define DC_STR_AUDIO 11
5296 
5300 #define DC_STR_FILE 12
5301 
5306 #define DC_STR_STATUSLINE 13
5307 
5312 #define DC_STR_NEWGROUPDRAFT 14
5313 
5319 #define DC_STR_MSGGRPNAME 15
5320 
5324 #define DC_STR_MSGGRPIMGCHANGED 16
5325 
5330 #define DC_STR_MSGADDMEMBER 17
5331 
5336 #define DC_STR_MSGDELMEMBER 18
5337 
5341 #define DC_STR_MSGGROUPLEFT 19
5342 
5346 #define DC_STR_GIF 23
5347 
5351 #define DC_STR_ENCRYPTEDMSG 24
5352 
5356 #define DC_STR_E2E_AVAILABLE 25
5357 
5359 #define DC_STR_ENCR_TRANSP 27
5360 
5364 #define DC_STR_ENCR_NONE 28
5365 
5369 #define DC_STR_CANTDECRYPT_MSG_BODY 29
5370 
5374 #define DC_STR_FINGERPRINTS 30
5375 
5379 #define DC_STR_READRCPT 31
5380 
5385 #define DC_STR_READRCPT_MAILBODY 32
5386 
5390 #define DC_STR_MSGGRPIMGDELETED 33
5391 
5395 #define DC_STR_E2E_PREFERRED 34
5396 
5401 #define DC_STR_CONTACT_VERIFIED 35
5402 
5407 #define DC_STR_CONTACT_NOT_VERIFIED 36
5408 
5413 #define DC_STR_CONTACT_SETUP_CHANGED 37
5414 
5418 #define DC_STR_ARCHIVEDCHATS 40
5419 
5423 #define DC_STR_AC_SETUP_MSG_SUBJECT 42
5424 
5428 #define DC_STR_AC_SETUP_MSG_BODY 43
5429 
5434 #define DC_STR_CANNOT_LOGIN 60
5435 
5441 #define DC_STR_SERVER_RESPONSE 61
5442 
5449 #define DC_STR_MSGACTIONBYUSER 62
5450 
5456 #define DC_STR_MSGACTIONBYME 63
5457 
5461 #define DC_STR_MSGLOCATIONENABLED 64
5462 
5466 #define DC_STR_MSGLOCATIONDISABLED 65
5467 
5471 #define DC_STR_LOCATION 66
5472 
5476 #define DC_STR_STICKER 67
5477 
5481 #define DC_STR_DEVICE_MESSAGES 68
5482 
5486 #define DC_STR_SAVED_MESSAGES 69
5487 
5491 #define DC_STR_DEVICE_MESSAGES_HINT 70
5492 
5496 #define DC_STR_WELCOME_MESSAGE 71
5497 
5501 #define DC_STR_UNKNOWN_SENDER_FOR_CHAT 72
5502 
5508 #define DC_STR_SUBJECT_FOR_NEW_CONTACT 73
5509 
5514 #define DC_STR_FAILED_SENDING_TO 74
5515 
5519 #define DC_STR_EPHEMERAL_DISABLED 75
5520 
5526 #define DC_STR_EPHEMERAL_SECONDS 76
5527 
5531 #define DC_STR_EPHEMERAL_MINUTE 77
5532 
5536 #define DC_STR_EPHEMERAL_HOUR 78
5537 
5541 #define DC_STR_EPHEMERAL_DAY 79
5542 
5546 #define DC_STR_EPHEMERAL_WEEK 80
5547 
5549 #define DC_STR_EPHEMERAL_FOUR_WEEKS 81
5550 
5554 #define DC_STR_VIDEOCHAT_INVITATION 82
5555 
5560 #define DC_STR_VIDEOCHAT_INVITE_MSG_BODY 83
5561 
5566 #define DC_STR_CONFIGURATION_FAILED 84
5567 
5572 #define DC_STR_BAD_TIME_MSG_BODY 85
5573 
5577 #define DC_STR_UPDATE_REMINDER_MSG_BODY 86
5578 
5582 #define DC_STR_ERROR_NO_NETWORK 87
5583 
5587 #define DC_STR_PROTECTION_ENABLED 88
5588 
5592 #define DC_STR_PROTECTION_DISABLED 89
5593 
5598 #define DC_STR_REPLY_NOUN 90
5599 
5603 #define DC_STR_SELF_DELETED_MSG_BODY 91
5604 
5608 #define DC_STR_SERVER_TURNED_OFF 92
5609 
5613 //
5615 #define DC_STR_EPHEMERAL_MINUTES 93
5616 
5620 //
5622 #define DC_STR_EPHEMERAL_HOURS 94
5623 
5627 //
5629 #define DC_STR_EPHEMERAL_DAYS 95
5630 
5634 //
5636 #define DC_STR_EPHEMERAL_WEEKS 96
5637 
5641 #define DC_STR_FORWARDED 97
5642 
5648 #ifdef PY_CFFI_INC
5649 /* Helper utility to locate the header file when building python bindings. */
5650 char* _dc_header_file_location(void) {
5651  return __FILE__;
5652 }
5653 #endif
5654 
5655 
5656 #ifdef __cplusplus
5657 }
5658 #endif
5659 #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_marknoticed_contact
void dc_marknoticed_contact(dc_context_t *context, uint32_t contact_id)
Mark all messages sent by the given contact as noticed.
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_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_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_accounts_t::dc_accounts_import_account
uint32_t dc_accounts_import_account(dc_accounts_t *accounts, const char *tarfile)
Import a tarfile-backup to the account manager.
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_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_msg_t::dc_msg_get_real_chat_id
uint32_t dc_msg_get_real_chat_id(const dc_msg_t *msg)
Get the ID of chat the message belongs to.
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_create_chat_by_msg_id
uint32_t dc_create_chat_by_msg_id(dc_context_t *context, uint32_t msg_id)
Create a normal chat or a group chat by a messages ID that comes typically from the deaddrop,...
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_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_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_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_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_context_t::dc_decide_on_contact_request
uint32_t dc_decide_on_contact_request(dc_context_t *context, uint32_t msg_id, int decision)
Call this when the user decided about a deaddrop message ("Do you want to chat with NAME?...
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_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.