Delta Chat Core C Interface
Loading...
Searching...
No Matches
deltachat.h
1#ifndef __DELTACHAT_H__
2#define __DELTACHAT_H__
3#ifdef __cplusplus
4extern "C" {
5#endif
6
7
8#ifndef PY_CFFI
9#include <stdint.h>
10#include <time.h>
11#endif
12
13
14typedef struct _dc_context dc_context_t;
15typedef struct _dc_accounts dc_accounts_t;
16typedef struct _dc_array dc_array_t;
17typedef struct _dc_chatlist dc_chatlist_t;
18typedef struct _dc_chat dc_chat_t;
19typedef struct _dc_msg dc_msg_t;
20typedef struct _dc_contact dc_contact_t;
21typedef struct _dc_lot dc_lot_t;
22typedef struct _dc_event dc_event_t;
23typedef struct _dc_event_emitter dc_event_emitter_t;
24typedef struct _dc_event_channel dc_event_channel_t;
25typedef struct _dc_jsonrpc_instance dc_jsonrpc_instance_t;
26typedef struct _dc_backup_provider dc_backup_provider_t;
27
28// Alias for backwards compatibility, use dc_event_emitter_t instead.
29typedef struct _dc_event_emitter dc_accounts_event_emitter_t;
30
235
236
246
247// create/open/config/information
248
264dc_context_t* dc_context_new (const char* os_name, const char* dbfile, const char* blobdir);
265
266
283
284
304int dc_context_open (dc_context_t *context, const char* passphrase);
305
306
319int dc_context_change_passphrase (dc_context_t* context, const char* passphrase);
320
321
330
331
344
345
357uint32_t dc_get_id (dc_context_t* context);
358
359
376
377
386char* dc_get_blobdir (const dc_context_t* context);
387
388
517int dc_set_config (dc_context_t* context, const char* key, const char* value);
518
519
542char* dc_get_config (dc_context_t* context, const char* key);
543
544
556int dc_set_stock_translation(dc_context_t* context, uint32_t stock_id, const char* stock_msg);
557
558
571int dc_set_config_from_qr (dc_context_t* context, const char* qr);
572
573
588char* dc_get_info (const dc_context_t* context);
589
590
591
592
593
594#define DC_CONNECTIVITY_NOT_CONNECTED 1000
595#define DC_CONNECTIVITY_CONNECTING 2000
596#define DC_CONNECTIVITY_WORKING 3000
597#define DC_CONNECTIVITY_CONNECTED 4000
598
599
621
622
639
640
641// connect
642
700
701
721int dc_is_configured (const dc_context_t* context);
722
723
734void dc_start_io (dc_context_t* context);
735
751
775
776
777
793int dc_preconfigure_keypair (dc_context_t* context, const char *secret_data);
794
795
796// handle chatlists
797
798#define DC_GCL_ARCHIVED_ONLY 0x01
799#define DC_GCL_NO_SPECIALS 0x02
800#define DC_GCL_ADD_ALLDONE_HINT 0x04
801#define DC_GCL_FOR_FORWARDING 0x08
802
803
853dc_chatlist_t* dc_get_chatlist (dc_context_t* context, int flags, const char* query_str, uint32_t query_id);
854
855
856// handle chats
857
871uint32_t dc_create_chat_by_contact_id (dc_context_t* context, uint32_t contact_id);
872
873
885uint32_t dc_get_chat_id_by_contact_id (dc_context_t* context, uint32_t contact_id);
886
887
923uint32_t dc_send_msg (dc_context_t* context, uint32_t chat_id, dc_msg_t* msg);
924
939uint32_t dc_send_msg_sync (dc_context_t* context, uint32_t chat_id, dc_msg_t* msg);
940
941
961uint32_t dc_send_text_msg (dc_context_t* context, uint32_t chat_id, const char* text_to_send);
962
963
978void dc_send_edit_request (dc_context_t* context, uint32_t msg_id, const char* new_text);
979
980
993 void dc_send_delete_request (dc_context_t* context, const uint32_t* msg_ids, int msg_cnt);
994
995
1028int dc_send_webxdc_status_update (dc_context_t* context, uint32_t msg_id, const char* json, const char* descr);
1029
1030
1061char* dc_get_webxdc_status_updates (dc_context_t* context, uint32_t msg_id, uint32_t serial);
1062
1063
1074void dc_set_webxdc_integration (dc_context_t* context, const char* file);
1075
1076
1119uint32_t dc_init_webxdc_integration (dc_context_t* context, uint32_t chat_id);
1120
1121
1187uint32_t dc_place_outgoing_call (dc_context_t* context, uint32_t chat_id, const char* place_call_info, int has_video);
1188
1189
1209 int dc_accept_incoming_call (dc_context_t* context, uint32_t msg_id, const char* accept_call_info);
1210
1211
1233 int dc_end_call (dc_context_t* context, uint32_t msg_id);
1234
1235
1259void dc_set_draft (dc_context_t* context, uint32_t chat_id, dc_msg_t* msg);
1260
1261
1309uint32_t dc_add_device_msg (dc_context_t* context, const char* label, dc_msg_t* msg);
1310
1321int dc_was_device_msg_ever_added (dc_context_t* context, const char* label);
1322
1323
1336dc_msg_t* dc_get_draft (dc_context_t* context, uint32_t chat_id);
1337
1338
1339#define DC_GCM_ADDDAYMARKER 0x01
1340
1341
1363dc_array_t* dc_get_chat_msgs (dc_context_t* context, uint32_t chat_id, uint32_t flags, uint32_t marker1before);
1364
1365
1374int dc_get_msg_cnt (dc_context_t* context, uint32_t chat_id);
1375
1376
1394int dc_get_fresh_msg_cnt (dc_context_t* context, uint32_t chat_id);
1395
1396
1410
1411
1425int dc_estimate_deletion_cnt (dc_context_t* context, int from_server, int64_t seconds);
1426
1427
1447
1448
1472
1473
1497
1498
1512void dc_marknoticed_chat (dc_context_t* context, uint32_t chat_id);
1513
1514
1535void dc_markfresh_chat (dc_context_t* context, uint32_t chat_id);
1536
1537
1556dc_array_t* dc_get_chat_media (dc_context_t* context, uint32_t chat_id, int msg_type, int msg_type2, int msg_type3);
1557
1558
1570void dc_set_chat_visibility (dc_context_t* context, uint32_t chat_id, int visibility);
1571
1572
1598void dc_delete_chat (dc_context_t* context, uint32_t chat_id);
1599
1613void dc_block_chat (dc_context_t* context, uint32_t chat_id);
1614
1627void dc_accept_chat (dc_context_t* context, uint32_t chat_id);
1628
1651dc_array_t* dc_get_chat_contacts (dc_context_t* context, uint32_t chat_id);
1652
1663char* dc_get_chat_encrinfo (dc_context_t* context, uint32_t chat_id);
1664
1676uint32_t dc_get_chat_ephemeral_timer (dc_context_t* context, uint32_t chat_id);
1677
1700dc_array_t* dc_search_msgs (dc_context_t* context, uint32_t chat_id, const char* query);
1701
1702
1713dc_chat_t* dc_get_chat (dc_context_t* context, uint32_t chat_id);
1714
1715
1716// handle group chats
1717
1743uint32_t dc_create_group_chat (dc_context_t* context, int protect, const char* name);
1744
1745
1762
1763
1774int dc_is_contact_in_chat (dc_context_t* context, uint32_t chat_id, uint32_t contact_id);
1775
1776
1793int dc_add_contact_to_chat (dc_context_t* context, uint32_t chat_id, uint32_t contact_id);
1794
1795
1810int dc_remove_contact_from_chat (dc_context_t* context, uint32_t chat_id, uint32_t contact_id);
1811
1812
1828int dc_set_chat_name (dc_context_t* context, uint32_t chat_id, const char* name);
1829
1847int dc_set_chat_ephemeral_timer (dc_context_t* context, uint32_t chat_id, uint32_t timer);
1848
1869int dc_set_chat_profile_image (dc_context_t* context, uint32_t chat_id, const char* image);
1870
1871
1872
1894int dc_set_chat_mute_duration (dc_context_t* context, uint32_t chat_id, int64_t duration);
1895
1896// handle messages
1897
1910char* dc_get_msg_info (dc_context_t* context, uint32_t msg_id);
1911
1912
1960char* dc_get_msg_html (dc_context_t* context, uint32_t msg_id);
1961
1962
1982void dc_download_full_msg (dc_context_t* context, int msg_id);
1983
1984
1994void dc_delete_msgs (dc_context_t* context, const uint32_t* msg_ids, int msg_cnt);
1995
1996
2011void dc_forward_msgs (dc_context_t* context, const uint32_t* msg_ids, int msg_cnt, uint32_t chat_id);
2012
2013
2041void dc_save_msgs (dc_context_t* context, const uint32_t* msg_ids, int msg_cnt);
2042
2043
2060int dc_resend_msgs (dc_context_t* context, const uint32_t* msg_ids, int msg_cnt);
2061
2062
2093void dc_markseen_msgs (dc_context_t* context, const uint32_t* msg_ids, int msg_cnt);
2094
2095
2108dc_msg_t* dc_get_msg (dc_context_t* context, uint32_t msg_id);
2109
2110
2111// handle contacts
2112
2126int dc_may_be_valid_addr (const char* addr);
2127
2128
2152uint32_t dc_lookup_contact_id_by_addr (dc_context_t* context, const char* addr);
2153
2154
2182uint32_t dc_create_contact (dc_context_t* context, const char* name, const char* addr);
2183
2184
2185#define DC_GCL_ADD_SELF 0x02
2186#define DC_GCL_ADDRESS 0x04
2187
2188
2212int dc_add_address_book (dc_context_t* context, const char* addr_book);
2213
2214
2223char* dc_make_vcard (dc_context_t* context, uint32_t contact_id);
2224
2225
2235dc_array_t* dc_import_vcard (dc_context_t* context, const char* vcard);
2236
2237
2254dc_array_t* dc_get_contacts (dc_context_t* context, uint32_t flags, const char* query);
2255
2256
2266
2267
2277void dc_block_contact (dc_context_t* context, uint32_t contact_id, int block);
2278
2279
2290char* dc_get_contact_encrinfo (dc_context_t* context, uint32_t contact_id);
2291
2292
2305int dc_delete_contact (dc_context_t* context, uint32_t contact_id);
2306
2307
2321dc_contact_t* dc_get_contact (dc_context_t* context, uint32_t contact_id);
2322
2323
2324// import/export and tools
2325
2326#define DC_IMEX_EXPORT_SELF_KEYS 1 // param1 is a directory where the keys are written to
2327#define DC_IMEX_IMPORT_SELF_KEYS 2 // param1 is a directory where the keys are searched in and read from
2328#define DC_IMEX_EXPORT_BACKUP 11 // param1 is a directory where the backup is written to, param2 is a passphrase to encrypt the backup
2329#define DC_IMEX_IMPORT_BACKUP 12 // param1 is the file with the backup to import, param2 is the backup's passphrase
2330
2331
2376void dc_imex (dc_context_t* context, int what, const char* param1, const char* param2);
2377
2378
2428char* dc_imex_has_backup (dc_context_t* context, const char* dir);
2429
2430
2448
2449
2450// out-of-band verification
2451
2452#define DC_QR_ASK_VERIFYCONTACT 200 // id=contact
2453#define DC_QR_ASK_VERIFYGROUP 202 // text1=groupname
2454#define DC_QR_ASK_VERIFYBROADCAST 204 // text1=broadcast name
2455#define DC_QR_FPR_OK 210 // id=contact
2456#define DC_QR_FPR_MISMATCH 220 // id=contact
2457#define DC_QR_FPR_WITHOUT_ADDR 230 // test1=formatted fingerprint
2458#define DC_QR_ACCOUNT 250 // text1=domain
2459#define DC_QR_BACKUP2 252
2460#define DC_QR_BACKUP_TOO_NEW 255
2461#define DC_QR_PROXY 271 // text1=address (e.g. "127.0.0.1:9050")
2462#define DC_QR_ADDR 320 // id=contact
2463#define DC_QR_TEXT 330 // text1=text
2464#define DC_QR_URL 332 // text1=URL
2465#define DC_QR_ERROR 400 // text1=error string
2466#define DC_QR_WITHDRAW_VERIFYCONTACT 500
2467#define DC_QR_WITHDRAW_VERIFYGROUP 502 // text1=groupname
2468#define DC_QR_WITHDRAW_JOINBROADCAST 504 // text1=broadcast name
2469#define DC_QR_REVIVE_VERIFYCONTACT 510
2470#define DC_QR_REVIVE_VERIFYGROUP 512 // text1=groupname
2471#define DC_QR_REVIVE_JOINBROADCAST 514 // text1=broadcast name
2472#define DC_QR_LOGIN 520 // text1=email_address
2473
2566dc_lot_t* dc_check_qr (dc_context_t* context, const char* qr);
2567
2568
2593char* dc_get_securejoin_qr (dc_context_t* context, uint32_t chat_id);
2594
2595
2609char* dc_get_securejoin_qr_svg (dc_context_t* context, uint32_t chat_id);
2610
2634uint32_t dc_join_securejoin (dc_context_t* context, const char* qr);
2635
2636
2637// location streaming
2638
2639
2656void dc_send_locations_to_chat (dc_context_t* context, uint32_t chat_id, int seconds);
2657
2658
2672int dc_is_sending_locations_to_chat (dc_context_t* context, uint32_t chat_id);
2673
2674
2702int dc_set_location (dc_context_t* context, double latitude, double longitude, double accuracy);
2703
2704
2765dc_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);
2766
2767
2768// misc
2769
2781char* dc_create_qr_svg (const char* payload);
2782
2783
2798
2799
2812void dc_str_unref (char* str);
2813
2814
2820
2844
2845
2864
2865
2881
2892
2907
2931int dc_receive_backup (dc_context_t* context, const char* qr);
2932
2959
2982dc_accounts_t* dc_accounts_new (const char* dir, int writable);
2983
3012dc_accounts_t* dc_accounts_new_with_event_channel(const char* dir, int writable, dc_event_channel_t* events_channel);
3013
3021
3022
3039
3056
3071uint32_t dc_accounts_migrate_account (dc_accounts_t* accounts, const char* dbfile);
3072
3073
3085int dc_accounts_remove_account (dc_accounts_t* accounts, uint32_t account_id);
3086
3087
3097
3098
3110dc_context_t* dc_accounts_get_account (dc_accounts_t* accounts, uint32_t account_id);
3111
3112
3129
3130
3139int dc_accounts_select_account (dc_accounts_t* accounts, uint32_t account_id);
3140
3141
3152
3153
3163
3164
3175
3176
3190
3191
3208int dc_accounts_background_fetch (dc_accounts_t* accounts, uint64_t timeout);
3209
3210
3226
3227
3235void dc_accounts_set_push_device_token (dc_accounts_t* accounts, const char *token);
3236
3257
3258
3267
3268
3278
3279
3287size_t dc_array_get_cnt (const dc_array_t* array);
3288
3289
3298uint32_t dc_array_get_id (const dc_array_t* array, size_t index);
3299
3300
3310double dc_array_get_latitude (const dc_array_t* array, size_t index);
3311
3312
3322double dc_array_get_longitude (const dc_array_t* array, size_t index);
3323
3324
3335double dc_array_get_accuracy (const dc_array_t* array, size_t index);
3336
3337
3347int64_t dc_array_get_timestamp (const dc_array_t* array, size_t index);
3348
3349
3359uint32_t dc_array_get_chat_id (const dc_array_t* array, size_t index);
3360
3361
3371uint32_t dc_array_get_contact_id (const dc_array_t* array, size_t index);
3372
3373
3383uint32_t dc_array_get_msg_id (const dc_array_t* array, size_t index);
3384
3385
3400char* dc_array_get_marker (const dc_array_t* array, size_t index);
3401
3402
3413int dc_array_is_independent (const dc_array_t* array, size_t index);
3414
3415
3425int dc_array_search_id (const dc_array_t* array, uint32_t needle, size_t* ret_index);
3426
3427
3460
3461
3470
3471
3479size_t dc_chatlist_get_cnt (const dc_chatlist_t* chatlist);
3480
3481
3493uint32_t dc_chatlist_get_chat_id (const dc_chatlist_t* chatlist, size_t index);
3494
3495
3507uint32_t dc_chatlist_get_msg_id (const dc_chatlist_t* chatlist, size_t index);
3508
3509
3536dc_lot_t* dc_chatlist_get_summary (const dc_chatlist_t* chatlist, size_t index, dc_chat_t* chat);
3537
3538
3558dc_lot_t* dc_chatlist_get_summary2 (dc_context_t* context, uint32_t chat_id, uint32_t msg_id);
3559
3560
3577char* dc_chat_get_info_json (dc_context_t* context, size_t chat_id);
3578
3587
3588
3589#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)
3590#define DC_CHAT_ID_ARCHIVED_LINK 6 // only an indicator in a chatlist
3591#define DC_CHAT_ID_ALLDONE_HINT 7 // only an indicator in a chatlist
3592#define DC_CHAT_ID_LAST_SPECIAL 9 // larger chat IDs are "real" chats, their messages are "real" messages
3593
3594
3603
3604
3617uint32_t dc_chat_get_id (const dc_chat_t* chat);
3618
3619
3627int dc_chat_get_type (const dc_chat_t* chat);
3628
3629
3641
3642
3654char* dc_chat_get_name (const dc_chat_t* chat);
3655
3656
3671
3672
3685uint32_t dc_chat_get_color (const dc_chat_t* chat);
3686
3687
3697
3698
3716
3717
3739
3740
3750
3751
3767
3768
3780int dc_chat_can_send (const dc_chat_t* chat);
3781
3782
3792
3793
3807
3808
3820
3821
3829int dc_chat_is_muted (const dc_chat_t* chat);
3830
3831
3840
3841
3849
3850
3851#define DC_MSG_ID_MARKER1 1 // this is used by iOS to mark things in the message list
3852#define DC_MSG_ID_DAYMARKER 9
3853#define DC_MSG_ID_LAST_SPECIAL 9
3854
3855
3868dc_msg_t* dc_msg_new (dc_context_t* context, int viewtype);
3869
3870
3879
3880
3889uint32_t dc_msg_get_id (const dc_msg_t* msg);
3890
3891
3906uint32_t dc_msg_get_from_id (const dc_msg_t* msg);
3907
3908
3917uint32_t dc_msg_get_chat_id (const dc_msg_t* msg);
3918
3919
3929
3930
3972
3973
3990int64_t dc_msg_get_timestamp (const dc_msg_t* msg);
3991
3992
4005
4006
4021
4022
4042char* dc_msg_get_text (const dc_msg_t* msg);
4043
4044
4062char* dc_msg_get_subject (const dc_msg_t* msg);
4063
4064
4078char* dc_msg_get_file (const dc_msg_t* msg);
4079
4080
4091int dc_msg_save_file (const dc_msg_t* msg, const char* path);
4092
4093
4104
4105
4117
4118
4131char* dc_msg_get_webxdc_blob (const dc_msg_t* msg, const char* filename, size_t* ret_bytes);
4132
4133
4172
4173
4185uint64_t dc_msg_get_filebytes (const dc_msg_t* msg);
4186
4187
4203
4204
4220
4221
4234
4235
4249
4259int dc_msg_is_bot (const dc_msg_t* msg);
4260
4273
4287
4288
4312
4313
4325char* dc_msg_get_summarytext (const dc_msg_t* msg, int approx_characters);
4326
4327
4357
4358
4359
4375
4376
4387
4388
4399int dc_msg_is_sent (const dc_msg_t* msg);
4400
4401
4419
4420
4432 int dc_msg_is_edited (const dc_msg_t* msg);
4433
4434
4455int dc_msg_is_info (const dc_msg_t* msg);
4456
4457
4492
4493
4515
4516
4517// DC_INFO* uses the same values as SystemMessage in rust-land
4518#define DC_INFO_UNKNOWN 0
4519#define DC_INFO_GROUP_NAME_CHANGED 2
4520#define DC_INFO_GROUP_IMAGE_CHANGED 3
4521#define DC_INFO_MEMBER_ADDED_TO_GROUP 4
4522#define DC_INFO_MEMBER_REMOVED_FROM_GROUP 5
4523
4524// Deprecated as of 2026-03-16, not used for new messages.
4525#define DC_INFO_AUTOCRYPT_SETUP_MESSAGE 6
4526
4527#define DC_INFO_SECURE_JOIN_MESSAGE 7
4528#define DC_INFO_LOCATIONSTREAMING_ENABLED 8
4529#define DC_INFO_LOCATION_ONLY 9
4530#define DC_INFO_EPHEMERAL_TIMER_CHANGED 10
4531#define DC_INFO_PROTECTION_ENABLED 11
4532#define DC_INFO_INVALID_UNENCRYPTED_MAIL 13
4533#define DC_INFO_WEBXDC_INFO_MESSAGE 32
4534#define DC_INFO_CHAT_E2EE 50
4535#define DC_INFO_GROUP_DESCRIPTION_CHANGED 70
4536#define DC_INFO_MESSAGE_PINNED 71
4537
4538
4555
4556
4576char* dc_msg_get_error (const dc_msg_t* msg);
4577
4578
4603
4604
4631
4632
4641void dc_msg_set_text (dc_msg_t* msg, const char* text);
4642
4643
4668void dc_msg_set_html (dc_msg_t* msg, const char* html);
4669
4670
4680void dc_msg_set_subject (dc_msg_t* msg, const char* subject);
4681
4682
4695void dc_msg_set_override_sender_name(dc_msg_t* msg, const char* name);
4696
4697
4720void dc_msg_set_file_and_deduplicate(dc_msg_t* msg, const char* file, const char* name, const char* filemime);
4721
4722
4733void dc_msg_set_dimension (dc_msg_t* msg, int width, int height);
4734
4735
4745void dc_msg_set_duration (dc_msg_t* msg, int duration);
4746
4747
4764void dc_msg_set_location (dc_msg_t* msg, double latitude, double longitude);
4765
4766
4788void dc_msg_latefiling_mediasize (dc_msg_t* msg, int width, int height, int duration);
4789
4790
4805void dc_msg_set_quote (dc_msg_t* msg, const dc_msg_t* quote);
4806
4807
4823
4824
4847
4865
4866
4880
4881
4893uint32_t dc_msg_get_saved_msg_id (const dc_msg_t* msg);
4894
4895
4906 int dc_msg_is_pinned (const dc_msg_t* msg);
4907
4908
4928
4929
4930#define DC_CONTACT_ID_SELF 1
4931#define DC_CONTACT_ID_INFO 2 // centered messages as "member added", used in all chats
4932#define DC_CONTACT_ID_DEVICE 5 // messages "update info" in the device-chat
4933#define DC_CONTACT_ID_LAST_SPECIAL 9
4934
4935
4944
4945
4953uint32_t dc_contact_get_id (const dc_contact_t* contact);
4954
4955
4964char* dc_contact_get_addr (const dc_contact_t* contact);
4965
4966
4981char* dc_contact_get_name (const dc_contact_t* contact);
4982
4983
5004
5005
5022
5023
5024// dc_contact_get_first_name is removed,
5025// the following define is to make upgrading more smoothly.
5026#define dc_contact_get_first_name dc_contact_get_display_name
5027
5028
5044
5045
5058
5059
5071uint32_t dc_contact_get_color (const dc_contact_t* contact);
5072
5073
5086
5096
5097
5111
5112
5123
5124
5137
5146
5147
5160
5161
5190
5191
5202
5203
5204#define DC_TEXT1_DRAFT 1
5205#define DC_TEXT1_USERNAME 2
5206#define DC_TEXT1_SELF 3
5207
5208
5219
5220
5230char* dc_lot_get_text1 (const dc_lot_t* lot);
5231
5232
5242char* dc_lot_get_text2 (const dc_lot_t* lot);
5243
5244
5255
5256
5265
5266
5274uint32_t dc_lot_get_id (const dc_lot_t* lot);
5275
5276
5286int64_t dc_lot_get_timestamp (const dc_lot_t* lot);
5287
5288
5311
5312
5318#define DC_MSG_TEXT 10
5319
5320
5332#define DC_MSG_IMAGE 20
5333
5334
5340#define DC_MSG_GIF 21
5341
5342
5350#define DC_MSG_STICKER 23
5351
5352
5358#define DC_MSG_AUDIO 40
5359
5360
5367#define DC_MSG_VOICE 41
5368
5369
5378#define DC_MSG_VIDEO 50
5379
5380
5386#define DC_MSG_FILE 60
5387
5388
5404#define DC_MSG_CALL 71
5405
5406
5412#define DC_MSG_WEBXDC 80
5413
5418#define DC_MSG_VCARD 90
5419
5423
5424
5435
5439#define DC_STATE_UNDEFINED 0
5440
5444#define DC_STATE_IN_FRESH 10
5445
5449#define DC_STATE_IN_NOTICED 13
5450
5454#define DC_STATE_IN_SEEN 16
5455
5459#define DC_STATE_OUT_DRAFT 19
5460
5464#define DC_STATE_OUT_PENDING 20
5465
5469#define DC_STATE_OUT_FAILED 24
5470
5475#define DC_STATE_OUT_DELIVERED 26
5476
5480#define DC_STATE_OUT_MDN_RCVD 28
5481
5485
5486
5497
5502#define DC_CHAT_TYPE_UNDEFINED 0
5503
5511#define DC_CHAT_TYPE_SINGLE 100
5512
5520#define DC_CHAT_TYPE_GROUP 120
5521
5532#define DC_CHAT_TYPE_MAILINGLIST 140
5533
5545#define DC_CHAT_TYPE_OUT_BROADCAST 160
5546
5561#define DC_CHAT_TYPE_IN_BROADCAST 165
5562
5566
5567
5578
5582#define DC_SOCKET_AUTO 0
5583
5584
5588#define DC_SOCKET_SSL 1
5589
5590
5594#define DC_SOCKET_STARTTLS 2
5595
5596
5600#define DC_SOCKET_PLAIN 3
5601
5605
5617
5621#define DC_CERTCK_AUTO 0
5622
5627#define DC_CERTCK_STRICT 1
5628
5633#define DC_CERTCK_ACCEPT_INVALID 2
5634
5639#define DC_CERTCK_ACCEPT_INVALID_CERTIFICATES 3
5640
5644
5645
5651
5662
5671
5699void dc_jsonrpc_request(dc_jsonrpc_instance_t* jsonrpc_instance, const char* request);
5700
5711
5723char* dc_jsonrpc_blocking_call(dc_jsonrpc_instance_t* jsonrpc_instance, const char *input);
5724
5736
5744
5755
5773
5781
5794
5795// Alias for backwards compatibility, use dc_get_next_event instead.
5796#define dc_accounts_get_next_event dc_get_next_event
5797
5806
5807// Alias for backwards compatibility, use dc_event_emtitter_unref instead.
5808#define dc_accounts_event_emitter_unref dc_event_emitter_unref
5809
5816
5829
5830
5843
5844
5857
5858
5870
5871
5883
5884
5895
5896
5905
5906
5920
5929#define DC_EVENT_INFO 100
5930
5931
5938#define DC_EVENT_SMTP_CONNECTED 101
5939
5940
5947#define DC_EVENT_IMAP_CONNECTED 102
5948
5955#define DC_EVENT_SMTP_MESSAGE_SENT 103
5956
5963#define DC_EVENT_IMAP_MESSAGE_DELETED 104
5964
5971#define DC_EVENT_IMAP_MESSAGE_MOVED 105
5972
5979#define DC_EVENT_IMAP_INBOX_IDLE 106
5980
5987#define DC_EVENT_NEW_BLOB_FILE 150
5988
5995#define DC_EVENT_DELETED_BLOB_FILE 151
5996
6005#define DC_EVENT_WARNING 300
6006
6007
6025#define DC_EVENT_ERROR 400
6026
6027
6038#define DC_EVENT_ERROR_SELF_NOT_IN_GROUP 410
6039
6040
6051#define DC_EVENT_MSGS_CHANGED 2000
6052
6053
6060#define DC_EVENT_REACTIONS_CHANGED 2001
6061
6062
6075#define DC_EVENT_INCOMING_REACTION 2002
6076
6077
6078
6095#define DC_EVENT_INCOMING_WEBXDC_NOTIFY 2003
6096
6097
6110#define DC_EVENT_INCOMING_MSG 2005
6111
6123#define DC_EVENT_INCOMING_MSG_BUNCH 2006
6124
6125
6138#define DC_EVENT_MSGS_NOTICED 2008
6139
6140
6148#define DC_EVENT_MSG_DELIVERED 2010
6149
6150
6159#define DC_EVENT_MSG_FAILED 2012
6160
6161
6169#define DC_EVENT_MSG_READ 2015
6170
6171
6178#define DC_EVENT_MSG_DELETED 2016
6179
6187#define DC_EVENT_MSG_READ_COUNT_CHANGED 2018
6188
6189
6198#define DC_EVENT_CHAT_MODIFIED 2020
6199
6206#define DC_EVENT_CHAT_EPHEMERAL_TIMER_MODIFIED 2021
6207
6208
6218#define DC_EVENT_CHAT_DELETED 2023
6219
6220
6227#define DC_EVENT_CONTACTS_CHANGED 2030
6228
6229
6230
6238#define DC_EVENT_LOCATION_CHANGED 2035
6239
6240
6247#define DC_EVENT_CONFIGURE_PROGRESS 2041
6248
6249
6256#define DC_EVENT_IMEX_PROGRESS 2051
6257
6258
6269#define DC_EVENT_IMEX_FILE_WRITTEN 2052
6270
6271
6282#define DC_EVENT_SECUREJOIN_INVITER_PROGRESS 2060
6283
6284
6298#define DC_EVENT_SECUREJOIN_JOINER_PROGRESS 2061
6299
6300
6310#define DC_EVENT_CONNECTIVITY_CHANGED 2100
6311
6312
6317#define DC_EVENT_SELFAVATAR_CHANGED 2110
6318
6319
6329#define DC_EVENT_CONFIG_SYNCED 2111
6330
6331
6346#define DC_EVENT_WEBXDC_STATUS_UPDATE 2120
6347
6353
6354#define DC_EVENT_WEBXDC_INSTANCE_DELETED 2121
6355
6365
6366#define DC_EVENT_WEBXDC_REALTIME_DATA 2150
6367
6374
6375#define DC_EVENT_WEBXDC_REALTIME_ADVERTISEMENT 2151
6376
6385
6386#define DC_EVENT_ACCOUNTS_BACKGROUND_FETCH_DONE 2200
6387
6393
6394#define DC_EVENT_CHATLIST_CHANGED 2300
6395
6402
6403#define DC_EVENT_CHATLIST_ITEM_CHANGED 2301
6404
6410
6411#define DC_EVENT_ACCOUNTS_CHANGED 2302
6412
6422
6423#define DC_EVENT_ACCOUNTS_ITEM_CHANGED 2303
6424
6430#define DC_EVENT_CHANNEL_OVERFLOW 2400
6431
6432
6433
6453#define DC_EVENT_INCOMING_CALL 2550
6454
6464 #define DC_EVENT_INCOMING_CALL_ACCEPTED 2560
6465
6474#define DC_EVENT_OUTGOING_CALL_ACCEPTED 2570
6475
6484#define DC_EVENT_CALL_ENDED 2580
6485
6494#define DC_EVENT_TRANSPORTS_MODIFIED 2600
6495
6496
6500
6501
6502#define DC_EVENT_DATA1_IS_STRING(e) 0 // not used anymore
6503#define DC_EVENT_DATA2_IS_STRING(e) ((e)==DC_EVENT_CONFIGURE_PROGRESS || (e)==DC_EVENT_IMEX_FILE_WRITTEN || ((e)>=100 && (e)<=499))
6504
6505
6506/*
6507 * Values for dc_get|set_config("media_quality")
6508 */
6509#define DC_MEDIA_QUALITY_BALANCED 0
6510#define DC_MEDIA_QUALITY_WORSE 1
6511
6512
6523
6528#define DC_CHAT_VISIBILITY_NORMAL 0
6529
6542#define DC_CHAT_VISIBILITY_ARCHIVED 1
6543
6548#define DC_CHAT_VISIBILITY_PINNED 2
6549
6553
6554
6565
6569#define DC_DOWNLOAD_DONE 0
6570
6574#define DC_DOWNLOAD_AVAILABLE 10
6575
6579#define DC_DOWNLOAD_FAILURE 20
6580
6584#define DC_DOWNLOAD_UNDECIPHERABLE 30
6585
6589#define DC_DOWNLOAD_IN_PROGRESS 1000
6590
6591
6592
6596
6597
6616
6620#define DC_STR_NOMESSAGES 1
6621
6625#define DC_STR_SELF 2
6626
6630#define DC_STR_DRAFT 3
6631
6635#define DC_STR_VOICEMESSAGE 7
6636
6640#define DC_STR_IMAGE 9
6641
6645#define DC_STR_VIDEO 10
6646
6650#define DC_STR_AUDIO 11
6651
6655#define DC_STR_FILE 12
6656
6660#define DC_STR_GIF 23
6661
6665#define DC_STR_E2E_AVAILABLE 25
6666
6670#define DC_STR_ENCR_NONE 28
6671
6675#define DC_STR_FINGERPRINTS 30
6676
6681#define DC_STR_CONTACT_VERIFIED 35
6682
6686#define DC_STR_ARCHIVEDCHATS 40
6687
6692#define DC_STR_CANNOT_LOGIN 60
6693
6697#define DC_STR_MSGLOCATIONENABLED 64
6698
6702#define DC_STR_MSGLOCATIONDISABLED 65
6703
6707#define DC_STR_LOCATION 66
6708
6712#define DC_STR_STICKER 67
6713
6717#define DC_STR_DEVICE_MESSAGES 68
6718
6722#define DC_STR_SAVED_MESSAGES 69
6723
6727#define DC_STR_DEVICE_MESSAGES_HINT 70
6728
6732#define DC_STR_WELCOME_MESSAGE 71
6733
6739#define DC_STR_SUBJECT_FOR_NEW_CONTACT 73
6740
6745#define DC_STR_FAILED_SENDING_TO 74
6746
6751#define DC_STR_CONFIGURATION_FAILED 84
6752
6757#define DC_STR_BAD_TIME_MSG_BODY 85
6758
6762#define DC_STR_UPDATE_REMINDER_MSG_BODY 86
6763
6767#define DC_STR_ERROR_NO_NETWORK 87
6768
6773#define DC_STR_REPLY_NOUN 90
6774
6778#define DC_STR_SELF_DELETED_MSG_BODY 91
6779
6783#define DC_STR_FORWARDED 97
6784
6786#define DC_STR_QUOTA_EXCEEDING_MSG_BODY 98
6787
6791#define DC_STR_SYNC_MSG_SUBJECT 101
6792
6801#define DC_STR_SYNC_MSG_BODY 102
6802
6806#define DC_STR_INCOMING_MESSAGES 103
6807
6811#define DC_STR_OUTGOING_MESSAGES 104
6812
6816#define DC_STR_CONNECTED 107
6817
6821#define DC_STR_CONNTECTING 108
6822
6826#define DC_STR_UPDATING 109
6827
6831#define DC_STR_SENDING 110
6832
6836#define DC_STR_LAST_MSG_SENT_SUCCESSFULLY 111
6837
6843#define DC_STR_ERROR 112
6844
6848#define DC_STR_MESSAGES 114
6849
6853#define DC_STR_BROADCAST_LIST 115
6854
6858#define DC_STR_PART_OF_TOTAL_USED 116
6859
6867#define DC_STR_SECURE_JOIN_STARTED 117
6868
6877#define DC_STR_SECURE_JOIN_REPLIES 118
6878
6884#define DC_STR_SETUP_CONTACT_QR_DESC 119
6885
6891#define DC_STR_SECURE_JOIN_GROUP_QR_DESC 120
6892
6896#define DC_STR_NOT_CONNECTED 121
6897
6902#define DC_STR_GROUP_NAME_CHANGED_BY_YOU 124
6903
6909#define DC_STR_GROUP_NAME_CHANGED_BY_OTHER 125
6910
6912#define DC_STR_GROUP_IMAGE_CHANGED_BY_YOU 126
6913
6917#define DC_STR_GROUP_IMAGE_CHANGED_BY_OTHER 127
6918
6924#define DC_STR_ADD_MEMBER_BY_YOU 128
6925
6932#define DC_STR_ADD_MEMBER_BY_OTHER 129
6933
6939#define DC_STR_REMOVE_MEMBER_BY_YOU 130
6940
6947#define DC_STR_REMOVE_MEMBER_BY_OTHER 131
6948
6952#define DC_STR_GROUP_LEFT_BY_YOU 132
6953
6959#define DC_STR_GROUP_LEFT_BY_OTHER 133
6960
6964#define DC_STR_GROUP_IMAGE_DELETED_BY_YOU 134
6965
6971#define DC_STR_GROUP_IMAGE_DELETED_BY_OTHER 135
6972
6976#define DC_STR_LOCATION_ENABLED_BY_YOU 136
6977
6983#define DC_STR_LOCATION_ENABLED_BY_OTHER 137
6984
6988#define DC_STR_EPHEMERAL_TIMER_DISABLED_BY_YOU 138
6989
6995#define DC_STR_EPHEMERAL_TIMER_DISABLED_BY_OTHER 139
6996
7002#define DC_STR_EPHEMERAL_TIMER_SECONDS_BY_YOU 140
7003
7010#define DC_STR_EPHEMERAL_TIMER_SECONDS_BY_OTHER 141
7011
7015#define DC_STR_EPHEMERAL_TIMER_1_HOUR_BY_YOU 144
7016
7022#define DC_STR_EPHEMERAL_TIMER_1_HOUR_BY_OTHER 145
7023
7027#define DC_STR_EPHEMERAL_TIMER_1_DAY_BY_YOU 146
7028
7034#define DC_STR_EPHEMERAL_TIMER_1_DAY_BY_OTHER 147
7035
7039#define DC_STR_EPHEMERAL_TIMER_1_WEEK_BY_YOU 148
7040
7046#define DC_STR_EPHEMERAL_TIMER_1_WEEK_BY_OTHER 149
7047
7053#define DC_STR_EPHEMERAL_TIMER_MINUTES_BY_YOU 150
7054
7061#define DC_STR_EPHEMERAL_TIMER_MINUTES_BY_OTHER 151
7062
7068#define DC_STR_EPHEMERAL_TIMER_HOURS_BY_YOU 152
7069
7076#define DC_STR_EPHEMERAL_TIMER_HOURS_BY_OTHER 153
7077
7083#define DC_STR_EPHEMERAL_TIMER_DAYS_BY_YOU 154
7084
7091#define DC_STR_EPHEMERAL_TIMER_DAYS_BY_OTHER 155
7092
7098#define DC_STR_EPHEMERAL_TIMER_WEEKS_BY_YOU 156
7099
7106#define DC_STR_EPHEMERAL_TIMER_WEEKS_BY_OTHER 157
7107
7111#define DC_STR_EPHEMERAL_TIMER_1_YEAR_BY_YOU 158
7112
7118#define DC_STR_EPHEMERAL_TIMER_1_YEAR_BY_OTHER 159
7119
7123#define DC_STR_BACKUP_TRANSFER_QR 162
7124
7128#define DC_STR_BACKUP_TRANSFER_MSG_BODY 163
7129
7133#define DC_STR_CHAT_PROTECTION_ENABLED 170
7134
7138#define DC_STR_NEW_GROUP_SEND_FIRST_MESSAGE 172
7139
7145#define DC_STR_MESSAGE_ADD_MEMBER 173
7146
7152#define DC_STR_INVALID_UNENCRYPTED_MAIL 174
7153
7160#define DC_STR_YOU_REACTED 176
7161
7169#define DC_STR_REACTED_BY 177
7170
7174#define DC_STR_REMOVE_MEMBER 178
7175
7179#define DC_STR_SECUREJOIN_WAIT 190
7180
7182#define DC_STR_DONATION_REQUEST 193
7183
7185#define DC_STR_DECLINED_CALL 196
7186
7188#define DC_STR_CANCELED_CALL 197
7189
7191#define DC_STR_MISSED_CALL 198
7192
7196#define DC_STR_CHANNEL_LEFT_BY_YOU 200
7197
7203#define DC_STR_SECURE_JOIN_CHANNEL_QR_DESC 201
7204
7206#define DC_STR_MSG_YOU_JOINED_CHANNEL 202
7207
7213#define DC_STR_SECURE_JOIN_CHANNEL_STARTED 203
7214
7221#define DC_STR_CHANNEL_NAME_CHANGED 204
7222
7226#define DC_STR_CHANNEL_IMAGE_CHANGED 205
7227
7231#define DC_STR_STATS_MSG_BODY 210
7232
7236#define DC_STR_PROXY_ENABLED 220
7237
7241#define DC_STR_PROXY_ENABLED_DESCRIPTION 221
7242
7246#define DC_STR_CHAT_UNENCRYPTED_EXPLANATON 230
7247
7249#define DC_STR_OUTGOING_AUDIO_CALL 232
7250
7252#define DC_STR_OUTGOING_VIDEO_CALL 233
7253
7255#define DC_STR_INCOMING_AUDIO_CALL 234
7256
7258#define DC_STR_INCOMING_VIDEO_CALL 235
7259
7261#define DC_STR_GROUP_DESCRIPTION_CHANGED_BY_YOU 240
7262
7264#define DC_STR_GROUP_DESCRIPTION_CHANGED_BY_OTHER 241
7265
7269#define DC_STR_MESSAGES_ARE_E2EE 242
7270
7272#define DC_STR_MESSAGE_PINNED_BY_YOU 243
7273
7275#define DC_STR_MESSAGE_PINNED_BY_OTHER 244
7276
7280
7281
7282#ifdef PY_CFFI_INC
7283/* Helper utility to locate the header file when building python bindings. */
7284char* _dc_header_file_location(void) {
7285 return __FILE__;
7286}
7287#endif
7288
7289
7290#ifdef __cplusplus
7291}
7292#endif
7293#endif // __DELTACHAT_H__
This class provides functionality that can be used to manage several dc_context_t objects running at ...
int dc_accounts_select_account(dc_accounts_t *accounts, uint32_t account_id)
Change the selected account.
void dc_accounts_unref(dc_accounts_t *accounts)
Free an account manager object.
dc_event_emitter_t * dc_accounts_get_event_emitter(dc_accounts_t *accounts)
Create the event emitter that is used to receive events.
dc_context_t * dc_accounts_get_selected_account(dc_accounts_t *accounts)
Get the currently selected account.
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.
uint32_t dc_accounts_migrate_account(dc_accounts_t *accounts, const char *dbfile)
Migrate independent accounts into accounts managed by the account manager.
int dc_accounts_background_fetch(dc_accounts_t *accounts, uint64_t timeout)
Perform a background fetch for all accounts in parallel with a timeout.
dc_accounts_t * dc_accounts_new_with_event_channel(const char *dir, int writable, dc_event_channel_t *events_channel)
Create a new account manager with an existing events channel, which allows you to see events emitted ...
dc_context_t * dc_accounts_get_account(dc_accounts_t *accounts, uint32_t account_id)
Get an account context from an account ID.
dc_array_t * dc_accounts_get_all(dc_accounts_t *accounts)
List all accounts.
dc_jsonrpc_instance_t * dc_jsonrpc_init(dc_accounts_t *account_manager)
Create the jsonrpc instance that is used to call the jsonrpc.
void dc_accounts_set_push_device_token(dc_accounts_t *accounts, const char *token)
Sets device token for Apple Push Notification service.
void dc_accounts_start_io(dc_accounts_t *accounts)
Start job and IMAP/SMTP tasks for all accounts managed by the account manager.
void dc_accounts_stop_io(dc_accounts_t *accounts)
Stop job and IMAP/SMTP tasks for all accounts and return when they are finished.
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.
uint32_t dc_accounts_add_account(dc_accounts_t *accounts)
Add a new account to the account manager.
dc_accounts_t * dc_accounts_new(const char *dir, int writable)
Create a new account manager.
void dc_accounts_stop_background_fetch(dc_accounts_t *accounts)
Stop ongoing background fetch.
uint32_t dc_accounts_add_closed_account(dc_accounts_t *accounts)
Add a new closed account to the account manager.
int dc_accounts_remove_account(dc_accounts_t *accounts, uint32_t account_id)
Remove an account from the account manager.
An object containing a simple array.
void dc_array_unref(dc_array_t *array)
Free an array object.
double dc_array_get_accuracy(const dc_array_t *array, size_t index)
Return the accuracy of the item at the given index.
int64_t dc_array_get_timestamp(const dc_array_t *array, size_t index)
Return the timestamp of the item at the given index.
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.
int dc_array_is_independent(const dc_array_t *array, size_t index)
Return the independent-state of the location at the given index.
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.
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.
double dc_array_get_longitude(const dc_array_t *array, size_t index)
Return the longitude of the item at the given index.
size_t dc_array_get_cnt(const dc_array_t *array)
Find out the number of items in an array.
uint32_t dc_array_get_id(const dc_array_t *array, size_t index)
Get the item at the given index as an ID.
char * dc_array_get_marker(const dc_array_t *array, size_t index)
Return the marker-character of the item at the given index.
double dc_array_get_latitude(const dc_array_t *array, size_t index)
Return the latitude of the item at the given index.
Set up another device.
char * dc_backup_provider_get_qr(const dc_backup_provider_t *backup_provider)
Returns the QR code text that will offer the backup to other devices.
void dc_backup_provider_unref(dc_backup_provider_t *backup_provider)
Frees a dc_backup_provider_t object.
void dc_backup_provider_wait(dc_backup_provider_t *backup_provider)
Waits for the sending to finish.
char * dc_backup_provider_get_qr_svg(const dc_backup_provider_t *backup_provider)
Returns the QR code SVG image that will offer the backup to other devices.
dc_backup_provider_t * dc_backup_provider_new(dc_context_t *context)
Creates an object for sending a backup to another device.
An object representing a single chat in memory.
char * dc_chat_get_name(const dc_chat_t *chat)
Get name of a chat.
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().
int dc_chat_get_type(const dc_chat_t *chat)
Get chat type as one of the DC_CHAT_TYPE constants.
char * dc_chat_get_mailinglist_addr(const dc_chat_t *chat)
Returns the address where messages are sent to if the chat is a mailing list.
uint32_t dc_chat_get_id(const dc_chat_t *chat)
Get the chat ID.
int dc_chat_is_device_talk(const dc_chat_t *chat)
Check if a chat is a device-talk.
int64_t dc_chat_get_remaining_mute_duration(const dc_chat_t *chat)
Get the exact state of the mute of a chat.
int dc_chat_is_contact_request(const dc_chat_t *chat)
Check if a chat is a contact request chat.
int dc_chat_get_visibility(const dc_chat_t *chat)
Get visibility of chat.
void dc_chat_unref(dc_chat_t *chat)
Free a chat object.
int dc_chat_is_unpromoted(const dc_chat_t *chat)
Check if a group chat is still unpromoted.
uint32_t dc_chat_get_color(const dc_chat_t *chat)
Get a color for the chat.
int dc_chat_can_send(const dc_chat_t *chat)
Check if messages can be sent to a given chat.
int dc_chat_is_self_talk(const dc_chat_t *chat)
Check if a chat is a self talk.
char * dc_chat_get_profile_image(const dc_chat_t *chat)
Get the chat's profile image.
int dc_chat_is_protected(const dc_chat_t *chat)
Deprecated, always returns 0.
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()).
int dc_chat_is_encrypted(const dc_chat_t *chat)
Check if the chat is encrypted.
An object representing a single chatlist in memory.
uint32_t dc_chatlist_get_msg_id(const dc_chatlist_t *chatlist, size_t index)
Get a single message ID of a chatlist.
void dc_chatlist_unref(dc_chatlist_t *chatlist)
Free a chatlist object.
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.
uint32_t dc_chatlist_get_chat_id(const dc_chatlist_t *chatlist, size_t index)
Get a single chat ID of a chatlist.
size_t dc_chatlist_get_cnt(const dc_chatlist_t *chatlist)
Find out the number of chats in a chatlist.
An object representing a single contact in memory.
char * dc_contact_get_addr(const dc_contact_t *contact)
Get the e-mail address of a contact.
char * dc_contact_get_name_n_addr(const dc_contact_t *contact)
Get a summary of name and address.
int dc_contact_is_verified(dc_contact_t *contact)
Check if the contact can be added to protected chats.
int dc_contact_is_key_contact(dc_contact_t *contact)
Returns whether contact is a key-contact, i.e.
char * dc_contact_get_profile_image(const dc_contact_t *contact)
Get the contact's profile image.
void dc_contact_unref(dc_contact_t *contact)
Free a contact object.
char * dc_contact_get_auth_name(const dc_contact_t *contact)
Get original contact name.
int64_t dc_contact_get_last_seen(const dc_contact_t *contact)
Get the contact's last seen timestamp.
uint32_t dc_contact_get_verifier_id(dc_contact_t *contact)
Return the contact ID that verified a contact.
char * dc_contact_get_status(const dc_contact_t *contact)
Get the contact's status.
int dc_contact_is_blocked(const dc_contact_t *contact)
Check if a contact is blocked.
char * dc_contact_get_name(const dc_contact_t *contact)
Get the edited contact name.
char * dc_contact_get_display_name(const dc_contact_t *contact)
Get display name.
uint32_t dc_contact_get_color(const dc_contact_t *contact)
Get a color for the contact.
uint32_t dc_contact_get_id(const dc_contact_t *contact)
Get the ID of a contact.
int dc_contact_is_bot(dc_contact_t *contact)
Returns whether contact is a bot.
int dc_contact_was_seen_recently(const dc_contact_t *contact)
Check if the contact was seen recently.
An object representing a single account.
char * dc_imex_has_backup(dc_context_t *context, const char *dir)
Check if there is a backup file.
int dc_add_address_book(dc_context_t *context, const char *addr_book)
Add a number of contacts.
int dc_get_msg_cnt(dc_context_t *context, uint32_t chat_id)
Get the total number of messages in a chat.
dc_context_t * dc_context_new_closed(const char *dbfile)
Create a new context object.
char * dc_make_vcard(dc_context_t *context, uint32_t contact_id)
Make a vCard.
dc_array_t * dc_get_contacts(dc_context_t *context, uint32_t flags, const char *query)
Returns known and unblocked contacts.
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.
uint32_t dc_add_device_msg(dc_context_t *context, const char *label, dc_msg_t *msg)
Add a message to the device-chat.
void dc_send_delete_request(dc_context_t *context, const uint32_t *msg_ids, int msg_cnt)
Send chat members a request to delete the given messages.
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_array_t * dc_get_next_msgs(dc_context_t *context)
Returns the message IDs of all messages of any chat with a database ID higher than last_msg_id config...
uint32_t dc_init_webxdc_integration(dc_context_t *context, uint32_t chat_id)
Init a Webxdc integration.
char * dc_get_contact_encrinfo(dc_context_t *context, uint32_t contact_id)
Get encryption info for a contact.
uint32_t dc_lookup_contact_id_by_addr(dc_context_t *context, const char *addr)
Looks up a known and unblocked contact with a given e-mail address.
int dc_set_chat_profile_image(dc_context_t *context, uint32_t chat_id, const char *image)
Set group or broadcast channel profile image.
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.
void dc_maybe_network(dc_context_t *context)
This function should be called when there is a hint that the network is available again,...
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.
uint32_t dc_get_chat_ephemeral_timer(dc_context_t *context, uint32_t chat_id)
Get the chat's ephemeral message timer.
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 given chat or any chat.
dc_lot_t * dc_check_qr(dc_context_t *context, const char *qr)
Check a scanned QR code.
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.
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_contact_t * dc_get_contact(dc_context_t *context, uint32_t contact_id)
Get a single contact object.
void dc_stop_io(dc_context_t *context)
Stop job, IMAP, SMTP and other tasks and return when they are finished.
dc_msg_t * dc_get_draft(dc_context_t *context, uint32_t chat_id)
Get draft for a chat, if any.
int dc_preconfigure_keypair(dc_context_t *context, const char *secret_data)
Save a keypair as the default keys for the user.
char * dc_create_qr_svg(const char *payload)
Create a QR code from any input data.
char * dc_get_blobdir(const dc_context_t *context)
Get the blob directory.
dc_array_t * dc_get_blocked_contacts(dc_context_t *context)
Get blocked contacts.
void dc_context_unref(dc_context_t *context)
Free a context object.
void dc_stop_ongoing_process(dc_context_t *context)
Signal an ongoing process to stop.
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.
void dc_markfresh_chat(dc_context_t *context, uint32_t chat_id)
Mark the last incoming message in chat as fresh.
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.
char * dc_get_info(const dc_context_t *context)
Get information about the context.
int dc_receive_backup(dc_context_t *context, const char *qr)
Gets a backup offered by a dc_backup_provider_t object on another device.
int dc_is_sending_locations_to_chat(dc_context_t *context, uint32_t chat_id)
Check if location streaming is enabled.
void dc_block_chat(dc_context_t *context, uint32_t chat_id)
Block a chat.
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.
int dc_end_call(dc_context_t *context, uint32_t msg_id)
End incoming or outgoing call.
dc_array_t * dc_get_fresh_msgs(dc_context_t *context)
Returns the message IDs of all fresh messages of any chat.
int dc_set_stock_translation(dc_context_t *context, uint32_t stock_id, const char *stock_msg)
Set stock string translation.
void dc_set_webxdc_integration(dc_context_t *context, const char *file)
Set Webxdc file as integration.
int dc_set_chat_mute_duration(dc_context_t *context, uint32_t chat_id, int64_t duration)
Set mute duration of a chat.
dc_array_t * dc_wait_next_msgs(dc_context_t *context)
Waits for notification of new messages and returns an array of new message IDs.
int dc_get_fresh_msg_cnt(dc_context_t *context, uint32_t chat_id)
Get the number of fresh messages in a chat.
int dc_set_chat_name(dc_context_t *context, uint32_t chat_id, const char *name)
Set the name of a group or broadcast channel.
uint32_t dc_create_broadcast_list(dc_context_t *context)
Create a new broadcast list.
void dc_marknoticed_chat(dc_context_t *context, uint32_t chat_id)
Mark all messages in a chat as noticed.
int dc_set_chat_ephemeral_timer(dc_context_t *context, uint32_t chat_id, uint32_t timer)
Set the chat's ephemeral message timer.
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_array_t * dc_search_msgs(dc_context_t *context, uint32_t chat_id, const char *query)
Search messages containing the given query string.
int dc_may_be_valid_addr(const char *addr)
Rough check if a string may be a valid e-mail address.
int dc_is_configured(const dc_context_t *context)
Check if the context is already configured.
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()-option delete_device_afte...
int dc_get_connectivity(dc_context_t *context)
Get the current connectivity, i.e.
char * dc_get_last_error(dc_context_t *context)
Get last error string.
uint32_t dc_get_chat_id_by_contact_id(dc_context_t *context, uint32_t contact_id)
Check, if there is a single chat with a given contact.
char * dc_get_config(dc_context_t *context, const char *key)
Get a configuration option.
int dc_set_location(dc_context_t *context, double latitude, double longitude, double accuracy)
Set current location.
void dc_set_chat_visibility(dc_context_t *context, uint32_t chat_id, int visibility)
Set chat visibility to pinned, archived or normal.
int dc_add_contact_to_chat(dc_context_t *context, uint32_t chat_id, uint32_t contact_id)
Add a member to a group.
char * dc_get_msg_info(dc_context_t *context, uint32_t msg_id)
Get an informational text for a single message.
char * dc_get_connectivity_html(dc_context_t *context)
Get an overview of the current connectivity, and possibly more statistics.
dc_array_t * dc_get_chat_contacts(dc_context_t *context, uint32_t chat_id)
Get the contact IDs belonging to a chat.
dc_chat_t * dc_get_chat(dc_context_t *context, uint32_t chat_id)
Get a chat object by a chat ID.
uint32_t dc_get_id(dc_context_t *context)
Get the ID of a context object.
dc_context_t * dc_context_new(const char *os_name, const char *dbfile, const char *blobdir)
Create a new context object and try to open it.
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.
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.
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.
void dc_download_full_msg(dc_context_t *context, int msg_id)
Asks the core to start downloading a message fully.
char * dc_get_msg_html(dc_context_t *context, uint32_t msg_id)
Get uncut message, if available.
dc_event_emitter_t * dc_get_event_emitter(dc_context_t *context)
Create the event emitter that is used to receive events.
void dc_start_io(dc_context_t *context)
Start job and IMAP/SMTP tasks.
void dc_imex(dc_context_t *context, int what, const char *param1, const char *param2)
Import/export things.
char * dc_get_securejoin_qr_svg(dc_context_t *context, uint32_t chat_id)
Get QR code image from the QR code text generated by dc_get_securejoin_qr().
dc_array_t * dc_import_vcard(dc_context_t *context, const char *vcard)
Import a vCard.
char * dc_get_webxdc_status_updates(dc_context_t *context, uint32_t msg_id, uint32_t serial)
Get webxdc status updates.
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.
uint32_t dc_create_chat_by_contact_id(dc_context_t *context, uint32_t contact_id)
Create a normal chat with a single user.
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.
int dc_send_webxdc_status_update(dc_context_t *context, uint32_t msg_id, const char *json, const char *descr)
A webxdc instance sends a status update to its other members.
dc_chatlist_t * dc_get_similar_chatlist(dc_context_t *context, uint32_t chat_id)
Returns a list of similar chats.
void dc_save_msgs(dc_context_t *context, const uint32_t *msg_ids, int msg_cnt)
Save a copy of messages in "Saved Messages".
int dc_set_config_from_qr(dc_context_t *context, const char *qr)
Set configuration values from a QR code.
void dc_str_unref(char *str)
Release a string returned by another deltachat-core function.
void dc_send_edit_request(dc_context_t *context, uint32_t msg_id, const char *new_text)
Send chat members a request to edit the given message's text.
int dc_delete_contact(dc_context_t *context, uint32_t contact_id)
Delete a contact so that it disappears from the corresponding lists.
void dc_delete_chat(dc_context_t *context, uint32_t chat_id)
Delete a chat.
void dc_block_contact(dc_context_t *context, uint32_t contact_id, int block)
Block or unblock a contact.
int dc_resend_msgs(dc_context_t *context, const uint32_t *msg_ids, int msg_cnt)
Resend messages and make information available for newly added chat members.
void dc_delete_msgs(dc_context_t *context, const uint32_t *msg_ids, int msg_cnt)
Delete messages.
void dc_configure(dc_context_t *context)
Configure a context.
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...
void dc_markseen_msgs(dc_context_t *context, const uint32_t *msg_ids, int msg_cnt)
Mark messages as presented to the user.
uint32_t dc_create_group_chat(dc_context_t *context, int protect, const char *name)
Create a new group 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.
int dc_context_is_open(dc_context_t *context)
Returns 1 if database is open.
int dc_accept_incoming_call(dc_context_t *context, uint32_t msg_id, const char *accept_call_info)
Accept incoming call.
void dc_accept_chat(dc_context_t *context, uint32_t chat_id)
Accept a contact request chat.
int dc_context_open(dc_context_t *context, const char *passphrase)
Opens the database with the given passphrase.
int dc_context_change_passphrase(dc_context_t *context, const char *passphrase)
Changes the passphrase on the open database.
char * dc_get_chat_encrinfo(dc_context_t *context, uint32_t chat_id)
Get encryption info for a chat.
uint32_t dc_place_outgoing_call(dc_context_t *context, uint32_t chat_id, const char *place_call_info, int has_video)
Start an outgoing call.
int dc_set_config(dc_context_t *context, const char *key, const char *value)
Configure the context.
Opaque object that is used to create an event emitter which can be used log events during startup of ...
dc_event_channel_t * dc_event_channel_new(void)
Create a new event channel.
dc_event_emitter_t * dc_event_channel_get_event_emitter(dc_event_channel_t *event_channel)
Create the event emitter that is used to receive events.
void dc_event_channel_unref(dc_event_channel_t *event_channel)
Release/free the events channel structure.
Opaque object that is used to get events from a single context.
void dc_event_emitter_unref(dc_event_emitter_t *emitter)
Free a context event emitter object.
dc_event_t * dc_get_next_event(dc_event_emitter_t *emitter)
Get the next event from a context event emitter object.
Opaque object describing a single event.
void dc_event_unref(dc_event_t *event)
Free memory used by an event object.
int dc_event_get_data2_int(dc_event_t *event)
Get data associated with an event object.
char * dc_event_get_data1_str(dc_event_t *event)
Get data associated with an event object.
char * dc_event_get_data2_str(dc_event_t *event)
Get data associated with an event object.
uint32_t dc_event_get_account_id(dc_event_t *event)
Get the account ID this event belongs to.
int dc_event_get_id(dc_event_t *event)
Get the event ID from an event object.
int dc_event_get_data1_int(dc_event_t *event)
Get data associated with an event object.
Opaque object for using the json rpc api from the cffi bindings.
char * dc_jsonrpc_next_response(dc_jsonrpc_instance_t *jsonrpc_instance)
Get the next json_rpc response, blocks until there is a new event, so call this in a loop from a thre...
void dc_jsonrpc_unref(dc_jsonrpc_instance_t *jsonrpc_instance)
Free a jsonrpc instance.
char * dc_jsonrpc_blocking_call(dc_jsonrpc_instance_t *jsonrpc_instance, const char *input)
Make a JSON-RPC call and return a response.
void dc_jsonrpc_request(dc_jsonrpc_instance_t *jsonrpc_instance, const char *request)
Makes an asynchronous jsonrpc request, returns immediately and once the result is ready it can be ret...
An object containing a set of values.
int64_t dc_lot_get_timestamp(const dc_lot_t *lot)
Get the associated timestamp.
int dc_lot_get_state(const dc_lot_t *lot)
Get the associated state.
uint32_t dc_lot_get_id(const dc_lot_t *lot)
Get the associated ID.
int dc_lot_get_text1_meaning(const dc_lot_t *lot)
Get the meaning of the first string.
void dc_lot_unref(dc_lot_t *lot)
Frees an object containing a set of parameters.
char * dc_lot_get_text1(const dc_lot_t *lot)
Get first string.
char * dc_lot_get_text2(const dc_lot_t *lot)
Get second string.
An object representing a single message in memory.
void dc_msg_set_html(dc_msg_t *msg, const char *html)
Set the HTML part of a message object.
char * dc_msg_get_webxdc_blob(const dc_msg_t *msg, const char *filename, size_t *ret_bytes)
Return a file from inside a webxdc message.
uint32_t dc_msg_get_ephemeral_timer(const dc_msg_t *msg)
Get the ephemeral timer duration for a message.
char * dc_msg_get_filename(const dc_msg_t *msg)
Get an original attachment filename, with extension but without the path.
void dc_msg_set_override_sender_name(dc_msg_t *msg, const char *name)
Set different sender name for a message.
char * dc_msg_get_summarytext(const dc_msg_t *msg, int approx_characters)
Get a message summary as a single line of text.
int dc_msg_get_showpadlock(const dc_msg_t *msg)
Check if message was correctly encrypted and signed.
dc_lot_t * dc_msg_get_summary(const dc_msg_t *msg, const dc_chat_t *chat)
Get a summary for a message.
uint32_t dc_msg_get_chat_id(const dc_msg_t *msg)
Get the ID of the chat the message belongs to.
void dc_msg_set_quote(dc_msg_t *msg, const dc_msg_t *quote)
Set the message replying to.
int dc_msg_has_location(const dc_msg_t *msg)
Check if a message has a POI location bound to it.
char * dc_msg_get_text(const dc_msg_t *msg)
Get the text of the message.
int dc_msg_is_pinned(const dc_msg_t *msg)
Check if the message is pinned.
uint32_t dc_msg_get_from_id(const dc_msg_t *msg)
Get the ID of the contact who wrote the message.
int64_t dc_msg_get_ephemeral_timestamp(const dc_msg_t *msg)
Get the timestamp of the ephemeral message removal.
int dc_msg_get_download_state(const dc_msg_t *msg)
Check if the message is completely downloaded or if some further action is needed.
void dc_msg_set_duration(dc_msg_t *msg, int duration)
Set the duration associated with message object.
void dc_msg_set_file_and_deduplicate(dc_msg_t *msg, const char *file, const char *name, const char *filemime)
Sets the file associated with a message.
int dc_msg_save_file(const dc_msg_t *msg, const char *path)
Save file copy at the user-provided path.
void dc_msg_set_text(dc_msg_t *msg, const char *text)
Set the text of a message object.
int64_t dc_msg_get_timestamp(const dc_msg_t *msg)
Get the message sending time.
uint32_t dc_msg_get_original_msg_id(const dc_msg_t *msg)
Get original message ID for a saved message from the "Saved Messages" chat.
char * dc_msg_get_quoted_text(const dc_msg_t *msg)
Get quoted text, if any.
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...
void dc_msg_set_subject(dc_msg_t *msg, const char *subject)
Sets the email's subject.
int dc_msg_get_width(const dc_msg_t *msg)
Get the width of an image or a video.
char * dc_msg_get_filemime(const dc_msg_t *msg)
Get the MIME type of a file.
void dc_msg_unref(dc_msg_t *msg)
Free a message object.
char * dc_msg_get_webxdc_href(const dc_msg_t *msg)
Get link attached to an webxdc info message.
int dc_msg_is_bot(const dc_msg_t *msg)
Check if an incoming message is a bot message, i.e.
void dc_msg_set_dimension(dc_msg_t *msg, int width, int height)
Set the dimensions associated with message object.
int dc_msg_is_forwarded(const dc_msg_t *msg)
Check if the message is a forwarded message.
int dc_msg_has_deviating_timestamp(const dc_msg_t *msg)
Check if a message has a deviating timestamp.
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.
void dc_msg_latefiling_mediasize(dc_msg_t *msg, int width, int height, int duration)
Late filing information to a message.
int dc_msg_is_edited(const dc_msg_t *msg)
Check if the message was edited.
int dc_msg_get_state(const dc_msg_t *msg)
Get the state of a message.
void dc_msg_set_location(dc_msg_t *msg, double latitude, double longitude)
Set any location that should be bound to the message object.
uint64_t dc_msg_get_filebytes(const dc_msg_t *msg)
Get the size of the file.
char * dc_msg_get_subject(const dc_msg_t *msg)
Get the subject of the e-mail.
dc_msg_t * dc_msg_get_quoted_msg(const dc_msg_t *msg)
Get quoted message, if available.
uint32_t dc_msg_get_info_contact_id(const dc_msg_t *msg)
Return the contact ID of the profile to open when tapping the info message.
dc_msg_t * dc_msg_get_parent(const dc_msg_t *msg)
Get parent message, if available.
dc_msg_t * dc_msg_new(dc_context_t *context, int viewtype)
Create new message object.
int dc_msg_has_html(dc_msg_t *msg)
Checks if the message has a full HTML version.
int dc_msg_get_duration(const dc_msg_t *msg)
Get the duration of audio or video.
uint32_t dc_msg_get_id(const dc_msg_t *msg)
Get the ID of the message.
uint32_t dc_msg_get_saved_msg_id(const dc_msg_t *msg)
Check if a message was saved and return its ID inside "Saved Messages".
int dc_msg_get_info_type(const dc_msg_t *msg)
Get the type of an informational message.
int dc_msg_get_viewtype(const dc_msg_t *msg)
Get the type of the message.
int64_t dc_msg_get_sort_timestamp(const dc_msg_t *msg)
Get the message time used for sorting.
int dc_msg_get_height(const dc_msg_t *msg)
Get the height of an image or a video.
char * dc_msg_get_error(const dc_msg_t *msg)
Gets the error status of the message.
int dc_msg_is_sent(const dc_msg_t *msg)
Check if a message was sent successfully.
char * dc_msg_get_file(const dc_msg_t *msg)
Find out full path of the file associated with a message.
int64_t dc_msg_get_received_timestamp(const dc_msg_t *msg)
Get the message receive time.
char * dc_msg_get_webxdc_info(const dc_msg_t *msg)
Get info from a webxdc message, in JSON format.