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_provider dc_provider_t;
23typedef struct _dc_event dc_event_t;
24typedef struct _dc_event_emitter dc_event_emitter_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
380
381
390char* dc_get_blobdir (const dc_context_t* context);
391
392
531int dc_set_config (dc_context_t* context, const char* key, const char* value);
532
533
559char* dc_get_config (dc_context_t* context, const char* key);
560
561
573int dc_set_stock_translation(dc_context_t* context, uint32_t stock_id, const char* stock_msg);
574
575
589int dc_set_config_from_qr (dc_context_t* context, const char* qr);
590
591
606char* dc_get_info (const dc_context_t* context);
607
608
638char* dc_get_oauth2_url (dc_context_t* context, const char* addr, const char* redirect_uri);
639
640
641#define DC_CONNECTIVITY_NOT_CONNECTED 1000
642#define DC_CONNECTIVITY_CONNECTING 2000
643#define DC_CONNECTIVITY_WORKING 3000
644#define DC_CONNECTIVITY_CONNECTED 4000
645
646
668
669
686
687
688#define DC_PUSH_NOT_CONNECTED 0
689#define DC_PUSH_HEARTBEAT 1
690#define DC_PUSH_CONNECTED 2
691
704
705
706// connect
707
759
760
780int dc_is_configured (const dc_context_t* context);
781
782
793void dc_start_io (dc_context_t* context);
794
810
834
835
836
852int dc_preconfigure_keypair (dc_context_t* context, const char *secret_data);
853
854
855// handle chatlists
856
857#define DC_GCL_ARCHIVED_ONLY 0x01
858#define DC_GCL_NO_SPECIALS 0x02
859#define DC_GCL_ADD_ALLDONE_HINT 0x04
860#define DC_GCL_FOR_FORWARDING 0x08
861
862
912dc_chatlist_t* dc_get_chatlist (dc_context_t* context, int flags, const char* query_str, uint32_t query_id);
913
914
915// handle chats
916
930uint32_t dc_create_chat_by_contact_id (dc_context_t* context, uint32_t contact_id);
931
932
944uint32_t dc_get_chat_id_by_contact_id (dc_context_t* context, uint32_t contact_id);
945
946
982uint32_t dc_send_msg (dc_context_t* context, uint32_t chat_id, dc_msg_t* msg);
983
998uint32_t dc_send_msg_sync (dc_context_t* context, uint32_t chat_id, dc_msg_t* msg);
999
1000
1020uint32_t dc_send_text_msg (dc_context_t* context, uint32_t chat_id, const char* text_to_send);
1021
1022
1037void dc_send_edit_request (dc_context_t* context, uint32_t msg_id, const char* new_text);
1038
1039
1052 void dc_send_delete_request (dc_context_t* context, const uint32_t* msg_ids, int msg_cnt);
1053
1054
1087int dc_send_webxdc_status_update (dc_context_t* context, uint32_t msg_id, const char* json, const char* descr);
1088
1089
1120char* dc_get_webxdc_status_updates (dc_context_t* context, uint32_t msg_id, uint32_t serial);
1121
1122
1133void dc_set_webxdc_integration (dc_context_t* context, const char* file);
1134
1135
1178uint32_t dc_init_webxdc_integration (dc_context_t* context, uint32_t chat_id);
1179
1180
1243uint32_t dc_place_outgoing_call (dc_context_t* context, uint32_t chat_id, const char* place_call_info);
1244
1245
1265 int dc_accept_incoming_call (dc_context_t* context, uint32_t msg_id, const char* accept_call_info);
1266
1267
1289 int dc_end_call (dc_context_t* context, uint32_t msg_id);
1290
1291
1315void dc_set_draft (dc_context_t* context, uint32_t chat_id, dc_msg_t* msg);
1316
1317
1365uint32_t dc_add_device_msg (dc_context_t* context, const char* label, dc_msg_t* msg);
1366
1377int dc_was_device_msg_ever_added (dc_context_t* context, const char* label);
1378
1379
1392dc_msg_t* dc_get_draft (dc_context_t* context, uint32_t chat_id);
1393
1394
1395#define DC_GCM_ADDDAYMARKER 0x01
1396#define DC_GCM_INFO_ONLY 0x02
1397
1398
1421dc_array_t* dc_get_chat_msgs (dc_context_t* context, uint32_t chat_id, uint32_t flags, uint32_t marker1before);
1422
1423
1432int dc_get_msg_cnt (dc_context_t* context, uint32_t chat_id);
1433
1434
1452int dc_get_fresh_msg_cnt (dc_context_t* context, uint32_t chat_id);
1453
1454
1468
1469
1484int dc_estimate_deletion_cnt (dc_context_t* context, int from_server, int64_t seconds);
1485
1486
1506
1507
1531
1532
1556
1557
1571void dc_marknoticed_chat (dc_context_t* context, uint32_t chat_id);
1572
1573
1592dc_array_t* dc_get_chat_media (dc_context_t* context, uint32_t chat_id, int msg_type, int msg_type2, int msg_type3);
1593
1594
1606void dc_set_chat_visibility (dc_context_t* context, uint32_t chat_id, int visibility);
1607
1608
1634void dc_delete_chat (dc_context_t* context, uint32_t chat_id);
1635
1649void dc_block_chat (dc_context_t* context, uint32_t chat_id);
1650
1663void dc_accept_chat (dc_context_t* context, uint32_t chat_id);
1664
1687dc_array_t* dc_get_chat_contacts (dc_context_t* context, uint32_t chat_id);
1688
1699char* dc_get_chat_encrinfo (dc_context_t* context, uint32_t chat_id);
1700
1712uint32_t dc_get_chat_ephemeral_timer (dc_context_t* context, uint32_t chat_id);
1713
1736dc_array_t* dc_search_msgs (dc_context_t* context, uint32_t chat_id, const char* query);
1737
1738
1749dc_chat_t* dc_get_chat (dc_context_t* context, uint32_t chat_id);
1750
1751
1752// handle group chats
1753
1779uint32_t dc_create_group_chat (dc_context_t* context, int protect, const char* name);
1780
1781
1798
1799
1810int dc_is_contact_in_chat (dc_context_t* context, uint32_t chat_id, uint32_t contact_id);
1811
1812
1829int dc_add_contact_to_chat (dc_context_t* context, uint32_t chat_id, uint32_t contact_id);
1830
1831
1846int dc_remove_contact_from_chat (dc_context_t* context, uint32_t chat_id, uint32_t contact_id);
1847
1848
1863int dc_set_chat_name (dc_context_t* context, uint32_t chat_id, const char* name);
1864
1882int dc_set_chat_ephemeral_timer (dc_context_t* context, uint32_t chat_id, uint32_t timer);
1883
1903int dc_set_chat_profile_image (dc_context_t* context, uint32_t chat_id, const char* image);
1904
1905
1906
1928int dc_set_chat_mute_duration (dc_context_t* context, uint32_t chat_id, int64_t duration);
1929
1930// handle messages
1931
1944char* dc_get_msg_info (dc_context_t* context, uint32_t msg_id);
1945
1946
1994char* dc_get_msg_html (dc_context_t* context, uint32_t msg_id);
1995
1996
2016void dc_download_full_msg (dc_context_t* context, int msg_id);
2017
2018
2028void dc_delete_msgs (dc_context_t* context, const uint32_t* msg_ids, int msg_cnt);
2029
2030
2045void dc_forward_msgs (dc_context_t* context, const uint32_t* msg_ids, int msg_cnt, uint32_t chat_id);
2046
2047
2075void dc_save_msgs (dc_context_t* context, const uint32_t* msg_ids, int msg_cnt);
2076
2077
2094int dc_resend_msgs (dc_context_t* context, const uint32_t* msg_ids, int msg_cnt);
2095
2096
2127void dc_markseen_msgs (dc_context_t* context, const uint32_t* msg_ids, int msg_cnt);
2128
2129
2142dc_msg_t* dc_get_msg (dc_context_t* context, uint32_t msg_id);
2143
2144
2145// handle contacts
2146
2160int dc_may_be_valid_addr (const char* addr);
2161
2162
2186uint32_t dc_lookup_contact_id_by_addr (dc_context_t* context, const char* addr);
2187
2188
2216uint32_t dc_create_contact (dc_context_t* context, const char* name, const char* addr);
2217
2218
2219
2220// Deprecated 2025-05-20, setting this flag is a no-op.
2221#define DC_GCL_DEPRECATED_VERIFIED_ONLY 0x01
2222
2223#define DC_GCL_ADD_SELF 0x02
2224#define DC_GCL_ADDRESS 0x04
2225
2226
2250int dc_add_address_book (dc_context_t* context, const char* addr_book);
2251
2252
2261char* dc_make_vcard (dc_context_t* context, uint32_t contact_id);
2262
2263
2273dc_array_t* dc_import_vcard (dc_context_t* context, const char* vcard);
2274
2275
2292dc_array_t* dc_get_contacts (dc_context_t* context, uint32_t flags, const char* query);
2293
2294
2304
2305
2315
2316
2326void dc_block_contact (dc_context_t* context, uint32_t contact_id, int block);
2327
2328
2339char* dc_get_contact_encrinfo (dc_context_t* context, uint32_t contact_id);
2340
2341
2354int dc_delete_contact (dc_context_t* context, uint32_t contact_id);
2355
2356
2370dc_contact_t* dc_get_contact (dc_context_t* context, uint32_t contact_id);
2371
2372
2373// import/export and tools
2374
2375#define DC_IMEX_EXPORT_SELF_KEYS 1 // param1 is a directory where the keys are written to
2376#define DC_IMEX_IMPORT_SELF_KEYS 2 // param1 is a directory where the keys are searched in and read from
2377#define DC_IMEX_EXPORT_BACKUP 11 // param1 is a directory where the backup is written to, param2 is a passphrase to encrypt the backup
2378#define DC_IMEX_IMPORT_BACKUP 12 // param1 is the file with the backup to import, param2 is the backup's passphrase
2379
2380
2425void dc_imex (dc_context_t* context, int what, const char* param1, const char* param2);
2426
2427
2477char* dc_imex_has_backup (dc_context_t* context, const char* dir);
2478
2479
2525
2526
2547int dc_continue_key_transfer (dc_context_t* context, uint32_t msg_id, const char* setup_code);
2548
2549
2567
2568
2569// out-of-band verification
2570
2571#define DC_QR_ASK_VERIFYCONTACT 200 // id=contact
2572#define DC_QR_ASK_VERIFYGROUP 202 // text1=groupname
2573#define DC_QR_ASK_VERIFYBROADCAST 204 // text1=broadcast name
2574#define DC_QR_FPR_OK 210 // id=contact
2575#define DC_QR_FPR_MISMATCH 220 // id=contact
2576#define DC_QR_FPR_WITHOUT_ADDR 230 // test1=formatted fingerprint
2577#define DC_QR_ACCOUNT 250 // text1=domain
2578#define DC_QR_BACKUP 251 // deprecated
2579#define DC_QR_BACKUP2 252
2580#define DC_QR_BACKUP_TOO_NEW 255
2581#define DC_QR_PROXY 271 // text1=address (e.g. "127.0.0.1:9050")
2582#define DC_QR_ADDR 320 // id=contact
2583#define DC_QR_TEXT 330 // text1=text
2584#define DC_QR_URL 332 // text1=URL
2585#define DC_QR_ERROR 400 // text1=error string
2586#define DC_QR_WITHDRAW_VERIFYCONTACT 500
2587#define DC_QR_WITHDRAW_VERIFYGROUP 502 // text1=groupname
2588#define DC_QR_WITHDRAW_JOINBROADCAST 504 // text1=broadcast name
2589#define DC_QR_REVIVE_VERIFYCONTACT 510
2590#define DC_QR_REVIVE_VERIFYGROUP 512 // text1=groupname
2591#define DC_QR_REVIVE_JOINBROADCAST 514 // text1=broadcast name
2592#define DC_QR_LOGIN 520 // text1=email_address
2593
2686dc_lot_t* dc_check_qr (dc_context_t* context, const char* qr);
2687
2688
2713char* dc_get_securejoin_qr (dc_context_t* context, uint32_t chat_id);
2714
2715
2729char* dc_get_securejoin_qr_svg (dc_context_t* context, uint32_t chat_id);
2730
2754uint32_t dc_join_securejoin (dc_context_t* context, const char* qr);
2755
2756
2757// location streaming
2758
2759
2776void dc_send_locations_to_chat (dc_context_t* context, uint32_t chat_id, int seconds);
2777
2778
2792int dc_is_sending_locations_to_chat (dc_context_t* context, uint32_t chat_id);
2793
2794
2822int dc_set_location (dc_context_t* context, double latitude, double longitude, double accuracy);
2823
2824
2885dc_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);
2886
2887
2899
2900
2901// misc
2902
2914char* dc_create_qr_svg (const char* payload);
2915
2916
2931
2932
2945void dc_str_unref (char* str);
2946
2947
2953
2977
2978
2997
2998
3014
3025
3040
3064int dc_receive_backup (dc_context_t* context, const char* qr);
3065
3092
3115dc_accounts_t* dc_accounts_new (const char* dir, int writable);
3116
3117
3125
3126
3143
3160
3175uint32_t dc_accounts_migrate_account (dc_accounts_t* accounts, const char* dbfile);
3176
3177
3189int dc_accounts_remove_account (dc_accounts_t* accounts, uint32_t account_id);
3190
3191
3201
3202
3214dc_context_t* dc_accounts_get_account (dc_accounts_t* accounts, uint32_t account_id);
3215
3216
3233
3234
3243int dc_accounts_select_account (dc_accounts_t* accounts, uint32_t account_id);
3244
3245
3256
3257
3267
3268
3279
3280
3294
3295
3312int dc_accounts_background_fetch (dc_accounts_t* accounts, uint64_t timeout);
3313
3314
3330
3331
3339void dc_accounts_set_push_device_token (dc_accounts_t* accounts, const char *token);
3340
3361
3362
3371
3372
3382
3383
3391size_t dc_array_get_cnt (const dc_array_t* array);
3392
3393
3402uint32_t dc_array_get_id (const dc_array_t* array, size_t index);
3403
3404
3414double dc_array_get_latitude (const dc_array_t* array, size_t index);
3415
3416
3426double dc_array_get_longitude (const dc_array_t* array, size_t index);
3427
3428
3439double dc_array_get_accuracy (const dc_array_t* array, size_t index);
3440
3441
3451int64_t dc_array_get_timestamp (const dc_array_t* array, size_t index);
3452
3453
3463uint32_t dc_array_get_chat_id (const dc_array_t* array, size_t index);
3464
3465
3475uint32_t dc_array_get_contact_id (const dc_array_t* array, size_t index);
3476
3477
3487uint32_t dc_array_get_msg_id (const dc_array_t* array, size_t index);
3488
3489
3504char* dc_array_get_marker (const dc_array_t* array, size_t index);
3505
3506
3517int dc_array_is_independent (const dc_array_t* array, size_t index);
3518
3519
3529int dc_array_search_id (const dc_array_t* array, uint32_t needle, size_t* ret_index);
3530
3531
3564
3565
3574
3575
3583size_t dc_chatlist_get_cnt (const dc_chatlist_t* chatlist);
3584
3585
3597uint32_t dc_chatlist_get_chat_id (const dc_chatlist_t* chatlist, size_t index);
3598
3599
3611uint32_t dc_chatlist_get_msg_id (const dc_chatlist_t* chatlist, size_t index);
3612
3613
3640dc_lot_t* dc_chatlist_get_summary (const dc_chatlist_t* chatlist, size_t index, dc_chat_t* chat);
3641
3642
3662dc_lot_t* dc_chatlist_get_summary2 (dc_context_t* context, uint32_t chat_id, uint32_t msg_id);
3663
3664
3673
3674
3691char* dc_chat_get_info_json (dc_context_t* context, size_t chat_id);
3692
3701
3702
3703#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)
3704#define DC_CHAT_ID_ARCHIVED_LINK 6 // only an indicator in a chatlist
3705#define DC_CHAT_ID_ALLDONE_HINT 7 // only an indicator in a chatlist
3706#define DC_CHAT_ID_LAST_SPECIAL 9 // larger chat IDs are "real" chats, their messages are "real" messages
3707
3708
3717
3718
3731uint32_t dc_chat_get_id (const dc_chat_t* chat);
3732
3733
3764int dc_chat_get_type (const dc_chat_t* chat);
3765
3766
3778
3779
3791char* dc_chat_get_name (const dc_chat_t* chat);
3792
3793
3808
3809
3822uint32_t dc_chat_get_color (const dc_chat_t* chat);
3823
3824
3834
3835
3853
3854
3876
3877
3887
3888
3904
3905
3917int dc_chat_can_send (const dc_chat_t* chat);
3918
3919
3929
3930
3944
3945
3957
3958
3966int dc_chat_is_muted (const dc_chat_t* chat);
3967
3968
3977
3978
3986
3987
3988#define DC_MSG_ID_MARKER1 1 // this is used by iOS to mark things in the message list
3989#define DC_MSG_ID_DAYMARKER 9
3990#define DC_MSG_ID_LAST_SPECIAL 9
3991
3992
4005dc_msg_t* dc_msg_new (dc_context_t* context, int viewtype);
4006
4007
4016
4017
4026uint32_t dc_msg_get_id (const dc_msg_t* msg);
4027
4028
4043uint32_t dc_msg_get_from_id (const dc_msg_t* msg);
4044
4045
4054uint32_t dc_msg_get_chat_id (const dc_msg_t* msg);
4055
4056
4066
4067
4111
4112
4129int64_t dc_msg_get_timestamp (const dc_msg_t* msg);
4130
4131
4144
4145
4160
4161
4181char* dc_msg_get_text (const dc_msg_t* msg);
4182
4183
4201char* dc_msg_get_subject (const dc_msg_t* msg);
4202
4203
4217char* dc_msg_get_file (const dc_msg_t* msg);
4218
4219
4230int dc_msg_save_file (const dc_msg_t* msg, const char* path);
4231
4232
4243
4244
4256
4257
4270char* dc_msg_get_webxdc_blob (const dc_msg_t* msg, const char* filename, size_t* ret_bytes);
4271
4272
4309
4310
4321uint64_t dc_msg_get_filebytes (const dc_msg_t* msg);
4322
4323
4339
4340
4356
4357
4370
4371
4385
4395int dc_msg_is_bot (const dc_msg_t* msg);
4396
4409
4423
4424
4448
4449
4461char* dc_msg_get_summarytext (const dc_msg_t* msg, int approx_characters);
4462
4463
4493
4494
4495
4511
4512
4523
4524
4535int dc_msg_is_sent (const dc_msg_t* msg);
4536
4537
4555
4556
4568 int dc_msg_is_edited (const dc_msg_t* msg);
4569
4570
4591int dc_msg_is_info (const dc_msg_t* msg);
4592
4593
4626
4627
4649
4650
4651// DC_INFO* uses the same values as SystemMessage in rust-land
4652#define DC_INFO_UNKNOWN 0
4653#define DC_INFO_GROUP_NAME_CHANGED 2
4654#define DC_INFO_GROUP_IMAGE_CHANGED 3
4655#define DC_INFO_MEMBER_ADDED_TO_GROUP 4
4656#define DC_INFO_MEMBER_REMOVED_FROM_GROUP 5
4657#define DC_INFO_AUTOCRYPT_SETUP_MESSAGE 6
4658#define DC_INFO_SECURE_JOIN_MESSAGE 7
4659#define DC_INFO_LOCATIONSTREAMING_ENABLED 8
4660#define DC_INFO_LOCATION_ONLY 9
4661#define DC_INFO_EPHEMERAL_TIMER_CHANGED 10
4662#define DC_INFO_PROTECTION_ENABLED 11
4663#define DC_INFO_PROTECTION_DISABLED 12 // deprecated 2025-07
4664#define DC_INFO_INVALID_UNENCRYPTED_MAIL 13
4665#define DC_INFO_WEBXDC_INFO_MESSAGE 32
4666#define DC_INFO_CHAT_E2EE 50
4667
4668
4685
4686
4702
4703
4719
4720
4740char* dc_msg_get_error (const dc_msg_t* msg);
4741
4742
4767
4768
4795
4796
4805void dc_msg_set_text (dc_msg_t* msg, const char* text);
4806
4807
4832void dc_msg_set_html (dc_msg_t* msg, const char* html);
4833
4834
4844void dc_msg_set_subject (dc_msg_t* msg, const char* subject);
4845
4846
4859void dc_msg_set_override_sender_name(dc_msg_t* msg, const char* name);
4860
4861
4884void dc_msg_set_file_and_deduplicate(dc_msg_t* msg, const char* file, const char* name, const char* filemime);
4885
4886
4897void dc_msg_set_dimension (dc_msg_t* msg, int width, int height);
4898
4899
4909void dc_msg_set_duration (dc_msg_t* msg, int duration);
4910
4911
4928void dc_msg_set_location (dc_msg_t* msg, double latitude, double longitude);
4929
4930
4952void dc_msg_latefiling_mediasize (dc_msg_t* msg, int width, int height, int duration);
4953
4954
4969void dc_msg_set_quote (dc_msg_t* msg, const dc_msg_t* quote);
4970
4971
4987
4988
5011
5027
5028
5042
5043
5055uint32_t dc_msg_get_saved_msg_id (const dc_msg_t* msg);
5056
5057
5067
5087
5088
5089#define DC_CONTACT_ID_SELF 1
5090#define DC_CONTACT_ID_INFO 2 // centered messages as "member added", used in all chats
5091#define DC_CONTACT_ID_DEVICE 5 // messages "update info" in the device-chat
5092#define DC_CONTACT_ID_LAST_SPECIAL 9
5093
5094
5103
5104
5112uint32_t dc_contact_get_id (const dc_contact_t* contact);
5113
5114
5123char* dc_contact_get_addr (const dc_contact_t* contact);
5124
5125
5140char* dc_contact_get_name (const dc_contact_t* contact);
5141
5142
5163
5164
5181
5182
5183// dc_contact_get_first_name is removed,
5184// the following define is to make upgrading more smoothly.
5185#define dc_contact_get_first_name dc_contact_get_display_name
5186
5187
5203
5204
5217
5218
5230uint32_t dc_contact_get_color (const dc_contact_t* contact);
5231
5232
5245
5255
5256
5270
5271
5282
5283
5296
5305
5306
5319
5320
5349
5350
5356
5357
5371dc_provider_t* dc_provider_new_from_email (const dc_context_t* context, const char* email);
5372
5373
5388
5389
5402
5403
5419
5420
5432
5433
5441
5442
5453
5454
5455#define DC_TEXT1_DRAFT 1
5456#define DC_TEXT1_USERNAME 2
5457#define DC_TEXT1_SELF 3
5458
5459
5470
5471
5481char* dc_lot_get_text1 (const dc_lot_t* lot);
5482
5483
5493char* dc_lot_get_text2 (const dc_lot_t* lot);
5494
5495
5506
5507
5516
5517
5525uint32_t dc_lot_get_id (const dc_lot_t* lot);
5526
5527
5537int64_t dc_lot_get_timestamp (const dc_lot_t* lot);
5538
5539
5562
5563
5569#define DC_MSG_TEXT 10
5570
5571
5583#define DC_MSG_IMAGE 20
5584
5585
5591#define DC_MSG_GIF 21
5592
5593
5601#define DC_MSG_STICKER 23
5602
5603
5609#define DC_MSG_AUDIO 40
5610
5611
5618#define DC_MSG_VOICE 41
5619
5620
5629#define DC_MSG_VIDEO 50
5630
5631
5637#define DC_MSG_FILE 60
5638
5639
5655#define DC_MSG_CALL 71
5656
5657
5663#define DC_MSG_WEBXDC 80
5664
5669#define DC_MSG_VCARD 90
5670
5674
5675
5686
5690#define DC_STATE_UNDEFINED 0
5691
5695#define DC_STATE_IN_FRESH 10
5696
5700#define DC_STATE_IN_NOTICED 13
5701
5705#define DC_STATE_IN_SEEN 16
5706
5712#define DC_STATE_OUT_PREPARING 18
5713
5717#define DC_STATE_OUT_DRAFT 19
5718
5722#define DC_STATE_OUT_PENDING 20
5723
5727#define DC_STATE_OUT_FAILED 24
5728
5733#define DC_STATE_OUT_DELIVERED 26
5734
5738#define DC_STATE_OUT_MDN_RCVD 28
5739
5743
5744
5755
5760#define DC_CHAT_TYPE_UNDEFINED 0
5761
5765#define DC_CHAT_TYPE_SINGLE 100
5766
5770#define DC_CHAT_TYPE_GROUP 120
5771
5775#define DC_CHAT_TYPE_MAILINGLIST 140
5776
5788#define DC_CHAT_TYPE_OUT_BROADCAST 160
5789
5804#define DC_CHAT_TYPE_IN_BROADCAST 165
5805
5809
5810
5821
5825#define DC_SOCKET_AUTO 0
5826
5827
5831#define DC_SOCKET_SSL 1
5832
5833
5837#define DC_SOCKET_STARTTLS 2
5838
5839
5843#define DC_SOCKET_PLAIN 3
5844
5848
5849
5861
5862
5868#define DC_LP_AUTH_OAUTH2 0x2
5869
5870
5875#define DC_LP_AUTH_NORMAL 0x4
5876
5877
5881
5882#define DC_LP_AUTH_FLAGS (DC_LP_AUTH_OAUTH2|DC_LP_AUTH_NORMAL) // if none of these flags are set, the default is chosen
5883
5895
5899#define DC_CERTCK_AUTO 0
5900
5905#define DC_CERTCK_STRICT 1
5906
5911#define DC_CERTCK_ACCEPT_INVALID 2
5912
5917#define DC_CERTCK_ACCEPT_INVALID_CERTIFICATES 3
5918
5922
5923
5929
5940
5949
5976void dc_jsonrpc_request(dc_jsonrpc_instance_t* jsonrpc_instance, const char* request);
5977
5988
6000char* dc_jsonrpc_blocking_call(dc_jsonrpc_instance_t* jsonrpc_instance, const char *input);
6001
6009
6022
6023// Alias for backwards compatibility, use dc_get_next_event instead.
6024#define dc_accounts_get_next_event dc_get_next_event
6025
6034
6035// Alias for backwards compatibility, use dc_event_emtitter_unref instead.
6036#define dc_accounts_event_emitter_unref dc_event_emitter_unref
6037
6044
6057
6058
6071
6072
6085
6086
6098
6099
6111
6112
6123
6124
6133
6134
6148
6157#define DC_EVENT_INFO 100
6158
6159
6166#define DC_EVENT_SMTP_CONNECTED 101
6167
6168
6175#define DC_EVENT_IMAP_CONNECTED 102
6176
6183#define DC_EVENT_SMTP_MESSAGE_SENT 103
6184
6191#define DC_EVENT_IMAP_MESSAGE_DELETED 104
6192
6199#define DC_EVENT_IMAP_MESSAGE_MOVED 105
6200
6207#define DC_EVENT_IMAP_INBOX_IDLE 106
6208
6215#define DC_EVENT_NEW_BLOB_FILE 150
6216
6223#define DC_EVENT_DELETED_BLOB_FILE 151
6224
6233#define DC_EVENT_WARNING 300
6234
6235
6253#define DC_EVENT_ERROR 400
6254
6255
6266#define DC_EVENT_ERROR_SELF_NOT_IN_GROUP 410
6267
6268
6279#define DC_EVENT_MSGS_CHANGED 2000
6280
6281
6288#define DC_EVENT_REACTIONS_CHANGED 2001
6289
6290
6303#define DC_EVENT_INCOMING_REACTION 2002
6304
6305
6306
6323#define DC_EVENT_INCOMING_WEBXDC_NOTIFY 2003
6324
6325
6338#define DC_EVENT_INCOMING_MSG 2005
6339
6351#define DC_EVENT_INCOMING_MSG_BUNCH 2006
6352
6353
6366#define DC_EVENT_MSGS_NOTICED 2008
6367
6368
6376#define DC_EVENT_MSG_DELIVERED 2010
6377
6378
6387#define DC_EVENT_MSG_FAILED 2012
6388
6389
6397#define DC_EVENT_MSG_READ 2015
6398
6399
6406#define DC_EVENT_MSG_DELETED 2016
6407
6408
6417#define DC_EVENT_CHAT_MODIFIED 2020
6418
6425#define DC_EVENT_CHAT_EPHEMERAL_TIMER_MODIFIED 2021
6426
6427
6437#define DC_EVENT_CHAT_DELETED 2023
6438
6439
6446#define DC_EVENT_CONTACTS_CHANGED 2030
6447
6448
6449
6458#define DC_EVENT_LOCATION_CHANGED 2035
6459
6460
6467#define DC_EVENT_CONFIGURE_PROGRESS 2041
6468
6469
6476#define DC_EVENT_IMEX_PROGRESS 2051
6477
6478
6489#define DC_EVENT_IMEX_FILE_WRITTEN 2052
6490
6491
6502#define DC_EVENT_SECUREJOIN_INVITER_PROGRESS 2060
6503
6504
6518#define DC_EVENT_SECUREJOIN_JOINER_PROGRESS 2061
6519
6520
6530#define DC_EVENT_CONNECTIVITY_CHANGED 2100
6531
6532
6537#define DC_EVENT_SELFAVATAR_CHANGED 2110
6538
6539
6549#define DC_EVENT_CONFIG_SYNCED 2111
6550
6551
6566#define DC_EVENT_WEBXDC_STATUS_UPDATE 2120
6567
6573
6574#define DC_EVENT_WEBXDC_INSTANCE_DELETED 2121
6575
6585
6586#define DC_EVENT_WEBXDC_REALTIME_DATA 2150
6587
6594
6595#define DC_EVENT_WEBXDC_REALTIME_ADVERTISEMENT 2151
6596
6605
6606#define DC_EVENT_ACCOUNTS_BACKGROUND_FETCH_DONE 2200
6607
6613
6614#define DC_EVENT_CHATLIST_CHANGED 2300
6615
6622
6623#define DC_EVENT_CHATLIST_ITEM_CHANGED 2301
6624
6630
6631#define DC_EVENT_ACCOUNTS_CHANGED 2302
6632
6642
6643#define DC_EVENT_ACCOUNTS_ITEM_CHANGED 2303
6644
6650#define DC_EVENT_CHANNEL_OVERFLOW 2400
6651
6652
6653
6673#define DC_EVENT_INCOMING_CALL 2550
6674
6683 #define DC_EVENT_INCOMING_CALL_ACCEPTED 2560
6684
6693#define DC_EVENT_OUTGOING_CALL_ACCEPTED 2570
6694
6703#define DC_EVENT_CALL_ENDED 2580
6704
6705
6709
6710
6711#define DC_EVENT_DATA1_IS_STRING(e) 0 // not used anymore
6712#define DC_EVENT_DATA2_IS_STRING(e) ((e)==DC_EVENT_CONFIGURE_PROGRESS || (e)==DC_EVENT_IMEX_FILE_WRITTEN || ((e)>=100 && (e)<=499))
6713
6714
6715/*
6716 * Values for dc_get|set_config("show_emails")
6717 */
6718#define DC_SHOW_EMAILS_OFF 0
6719#define DC_SHOW_EMAILS_ACCEPTED_CONTACTS 1
6720#define DC_SHOW_EMAILS_ALL 2
6721
6722
6723/*
6724 * Values for dc_get|set_config("media_quality")
6725 */
6726#define DC_MEDIA_QUALITY_BALANCED 0
6727#define DC_MEDIA_QUALITY_WORSE 1
6728
6729
6738
6751#define DC_PROVIDER_STATUS_OK 1
6752
6764#define DC_PROVIDER_STATUS_PREPARATION 2
6765
6778#define DC_PROVIDER_STATUS_BROKEN 3
6779
6783
6784
6795
6800#define DC_CHAT_VISIBILITY_NORMAL 0
6801
6814#define DC_CHAT_VISIBILITY_ARCHIVED 1
6815
6820#define DC_CHAT_VISIBILITY_PINNED 2
6821
6825
6826
6837
6841#define DC_DOWNLOAD_DONE 0
6842
6846#define DC_DOWNLOAD_AVAILABLE 10
6847
6851#define DC_DOWNLOAD_FAILURE 20
6852
6856#define DC_DOWNLOAD_UNDECIPHERABLE 30
6857
6861#define DC_DOWNLOAD_IN_PROGRESS 1000
6862
6863
6864
6868
6869
6888
6892#define DC_STR_NOMESSAGES 1
6893
6897#define DC_STR_SELF 2
6898
6902#define DC_STR_DRAFT 3
6903
6907#define DC_STR_VOICEMESSAGE 7
6908
6912#define DC_STR_IMAGE 9
6913
6917#define DC_STR_VIDEO 10
6918
6922#define DC_STR_AUDIO 11
6923
6927#define DC_STR_FILE 12
6928
6936#define DC_STR_MSGGRPNAME 15
6937
6943#define DC_STR_MSGGRPIMGCHANGED 16
6944
6951#define DC_STR_MSGADDMEMBER 17
6952
6959#define DC_STR_MSGDELMEMBER 18
6960
6966#define DC_STR_MSGGROUPLEFT 19
6967
6971#define DC_STR_GIF 23
6972
6974#define DC_STR_ENCRYPTEDMSG 24
6975
6979#define DC_STR_E2E_AVAILABLE 25
6980
6982#define DC_STR_ENCR_TRANSP 27
6983
6987#define DC_STR_ENCR_NONE 28
6988
6992#define DC_STR_FINGERPRINTS 30
6993
6999#define DC_STR_READRCPT 31
7000
7007#define DC_STR_READRCPT_MAILBODY 32
7008
7010#define DC_STR_MSGGRPIMGDELETED 33
7011
7016#define DC_STR_E2E_PREFERRED 34
7017
7022#define DC_STR_CONTACT_VERIFIED 35
7023
7029#define DC_STR_CONTACT_NOT_VERIFIED 36
7030
7036#define DC_STR_CONTACT_SETUP_CHANGED 37
7037
7041#define DC_STR_ARCHIVEDCHATS 40
7042
7046#define DC_STR_AC_SETUP_MSG_SUBJECT 42
7047
7051#define DC_STR_AC_SETUP_MSG_BODY 43
7052
7057#define DC_STR_CANNOT_LOGIN 60
7058
7067#define DC_STR_MSGACTIONBYUSER 62
7068
7076#define DC_STR_MSGACTIONBYME 63
7077
7081#define DC_STR_MSGLOCATIONENABLED 64
7082
7086#define DC_STR_MSGLOCATIONDISABLED 65
7087
7091#define DC_STR_LOCATION 66
7092
7096#define DC_STR_STICKER 67
7097
7101#define DC_STR_DEVICE_MESSAGES 68
7102
7106#define DC_STR_SAVED_MESSAGES 69
7107
7111#define DC_STR_DEVICE_MESSAGES_HINT 70
7112
7116#define DC_STR_WELCOME_MESSAGE 71
7117
7123#define DC_STR_UNKNOWN_SENDER_FOR_CHAT 72
7124
7130#define DC_STR_SUBJECT_FOR_NEW_CONTACT 73
7131
7136#define DC_STR_FAILED_SENDING_TO 74
7137
7143#define DC_STR_EPHEMERAL_DISABLED 75
7144
7152#define DC_STR_EPHEMERAL_SECONDS 76
7153
7159#define DC_STR_EPHEMERAL_MINUTE 77
7160
7166#define DC_STR_EPHEMERAL_HOUR 78
7167
7173#define DC_STR_EPHEMERAL_DAY 79
7174
7180#define DC_STR_EPHEMERAL_WEEK 80
7181
7183#define DC_STR_EPHEMERAL_FOUR_WEEKS 81
7184
7189#define DC_STR_CONFIGURATION_FAILED 84
7190
7195#define DC_STR_BAD_TIME_MSG_BODY 85
7196
7200#define DC_STR_UPDATE_REMINDER_MSG_BODY 86
7201
7205#define DC_STR_ERROR_NO_NETWORK 87
7206
7211#define DC_STR_REPLY_NOUN 90
7212
7216#define DC_STR_SELF_DELETED_MSG_BODY 91
7217
7225#define DC_STR_EPHEMERAL_MINUTES 93
7226
7234#define DC_STR_EPHEMERAL_HOURS 94
7235
7243#define DC_STR_EPHEMERAL_DAYS 95
7244
7252#define DC_STR_EPHEMERAL_WEEKS 96
7253
7257#define DC_STR_FORWARDED 97
7258
7264#define DC_STR_QUOTA_EXCEEDING_MSG_BODY 98
7265
7273#define DC_STR_PARTIAL_DOWNLOAD_MSG_BODY 99
7274
7280#define DC_STR_DOWNLOAD_AVAILABILITY 100
7281
7285#define DC_STR_SYNC_MSG_SUBJECT 101
7286
7295#define DC_STR_SYNC_MSG_BODY 102
7296
7300#define DC_STR_INCOMING_MESSAGES 103
7301
7305#define DC_STR_OUTGOING_MESSAGES 104
7306
7312#define DC_STR_STORAGE_ON_DOMAIN 105
7313
7315#define DC_STR_ONE_MOMENT 106
7316
7320#define DC_STR_CONNECTED 107
7321
7325#define DC_STR_CONNTECTING 108
7326
7330#define DC_STR_UPDATING 109
7331
7335#define DC_STR_SENDING 110
7336
7340#define DC_STR_LAST_MSG_SENT_SUCCESSFULLY 111
7341
7347#define DC_STR_ERROR 112
7348
7352#define DC_STR_NOT_SUPPORTED_BY_PROVIDER 113
7353
7357#define DC_STR_MESSAGES 114
7358
7362#define DC_STR_BROADCAST_LIST 115
7363
7367#define DC_STR_PART_OF_TOTAL_USED 116
7368
7377#define DC_STR_SECURE_JOIN_STARTED 117
7378
7387#define DC_STR_SECURE_JOIN_REPLIES 118
7388
7394#define DC_STR_SETUP_CONTACT_QR_DESC 119
7395
7401#define DC_STR_SECURE_JOIN_GROUP_QR_DESC 120
7402
7406#define DC_STR_NOT_CONNECTED 121
7407
7412#define DC_STR_AEAP_ADDR_CHANGED 122
7413
7418#define DC_STR_GROUP_NAME_CHANGED_BY_YOU 124
7419
7425#define DC_STR_GROUP_NAME_CHANGED_BY_OTHER 125
7426
7428#define DC_STR_GROUP_IMAGE_CHANGED_BY_YOU 126
7429
7433#define DC_STR_GROUP_IMAGE_CHANGED_BY_OTHER 127
7434
7440#define DC_STR_ADD_MEMBER_BY_YOU 128
7441
7448#define DC_STR_ADD_MEMBER_BY_OTHER 129
7449
7455#define DC_STR_REMOVE_MEMBER_BY_YOU 130
7456
7463#define DC_STR_REMOVE_MEMBER_BY_OTHER 131
7464
7468#define DC_STR_GROUP_LEFT_BY_YOU 132
7469
7475#define DC_STR_GROUP_LEFT_BY_OTHER 133
7476
7480#define DC_STR_GROUP_IMAGE_DELETED_BY_YOU 134
7481
7487#define DC_STR_GROUP_IMAGE_DELETED_BY_OTHER 135
7488
7492#define DC_STR_LOCATION_ENABLED_BY_YOU 136
7493
7499#define DC_STR_LOCATION_ENABLED_BY_OTHER 137
7500
7504#define DC_STR_EPHEMERAL_TIMER_DISABLED_BY_YOU 138
7505
7511#define DC_STR_EPHEMERAL_TIMER_DISABLED_BY_OTHER 139
7512
7518#define DC_STR_EPHEMERAL_TIMER_SECONDS_BY_YOU 140
7519
7526#define DC_STR_EPHEMERAL_TIMER_SECONDS_BY_OTHER 141
7527
7531#define DC_STR_EPHEMERAL_TIMER_1_MINUTE_BY_YOU 142
7532
7537#define DC_STR_EPHEMERAL_TIMER_1_MINUTE_BY_OTHER 143
7538
7542#define DC_STR_EPHEMERAL_TIMER_1_HOUR_BY_YOU 144
7543
7549#define DC_STR_EPHEMERAL_TIMER_1_HOUR_BY_OTHER 145
7550
7554#define DC_STR_EPHEMERAL_TIMER_1_DAY_BY_YOU 146
7555
7561#define DC_STR_EPHEMERAL_TIMER_1_DAY_BY_OTHER 147
7562
7566#define DC_STR_EPHEMERAL_TIMER_1_WEEK_BY_YOU 148
7567
7573#define DC_STR_EPHEMERAL_TIMER_1_WEEK_BY_OTHER 149
7574
7580#define DC_STR_EPHEMERAL_TIMER_MINUTES_BY_YOU 150
7581
7588#define DC_STR_EPHEMERAL_TIMER_MINUTES_BY_OTHER 151
7589
7595#define DC_STR_EPHEMERAL_TIMER_HOURS_BY_YOU 152
7596
7603#define DC_STR_EPHEMERAL_TIMER_HOURS_BY_OTHER 153
7604
7610#define DC_STR_EPHEMERAL_TIMER_DAYS_BY_YOU 154
7611
7618#define DC_STR_EPHEMERAL_TIMER_DAYS_BY_OTHER 155
7619
7625#define DC_STR_EPHEMERAL_TIMER_WEEKS_BY_YOU 156
7626
7633#define DC_STR_EPHEMERAL_TIMER_WEEKS_BY_OTHER 157
7634
7638#define DC_STR_EPHEMERAL_TIMER_1_YEAR_BY_YOU 158
7639
7645#define DC_STR_EPHEMERAL_TIMER_1_YEAR_BY_OTHER 159
7646
7650#define DC_STR_BACKUP_TRANSFER_QR 162
7651
7655#define DC_STR_BACKUP_TRANSFER_MSG_BODY 163
7656
7660#define DC_STR_CHAT_PROTECTION_ENABLED 170
7661
7665#define DC_STR_NEW_GROUP_SEND_FIRST_MESSAGE 172
7666
7672#define DC_STR_MESSAGE_ADD_MEMBER 173
7673
7679#define DC_STR_INVALID_UNENCRYPTED_MAIL 174
7680
7687#define DC_STR_YOU_REACTED 176
7688
7696#define DC_STR_REACTED_BY 177
7697
7701#define DC_STR_REMOVE_MEMBER 178
7702
7706#define DC_STR_SECUREJOIN_WAIT 190
7707
7711#define DC_STR_SECUREJOIN_WAIT_TIMEOUT 191
7712
7717#define DC_STR_SECUREJOIN_TAKES_LONGER 192
7718
7720#define DC_STR_DONATION_REQUEST 193
7721
7723#define DC_STR_OUTGOING_CALL 194
7724
7726#define DC_STR_INCOMING_CALL 195
7727
7729#define DC_STR_DECLINED_CALL 196
7730
7732#define DC_STR_CANCELED_CALL 197
7733
7735#define DC_STR_MISSED_CALL 198
7736
7740#define DC_STR_CHANNEL_LEFT_BY_YOU 200
7741
7747#define DC_STR_SECURE_JOIN_CHANNEL_QR_DESC 201
7748
7750#define DC_STR_MSG_YOU_JOINED_CHANNEL 202
7751
7757#define DC_STR_SECURE_JOIN_CHANNEL_STARTED 203
7758
7762#define DC_STR_STATS_MSG_BODY 210
7763
7767#define DC_STR_PROXY_ENABLED 220
7768
7772#define DC_STR_PROXY_ENABLED_DESCRIPTION 221
7773
7777#define DC_STR_CHAT_UNENCRYPTED_EXPLANATON 230
7778
7782
7783
7784#ifdef PY_CFFI_INC
7785/* Helper utility to locate the header file when building python bindings. */
7786char* _dc_header_file_location(void) {
7787 return __FILE__;
7788}
7789#endif
7790
7791
7792#ifdef __cplusplus
7793}
7794#endif
7795#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_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.
dc_context_t * dc_chatlist_get_context(dc_chatlist_t *chatlist)
Helper function to get the associated context object.
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 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.
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_continue_key_transfer(dc_context_t *context, uint32_t msg_id, const char *setup_code)
Continue the Autocrypt Key Transfer on another device.
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 group name.
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()-options delete_device_aft...
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.
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 authorization.
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.
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_get_push_state(dc_context_t *context)
Get the current push notification state.
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_place_outgoing_call(dc_context_t *context, uint32_t chat_id, const char *place_call_info)
Start an outgoing call.
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.
void dc_delete_all_locations(dc_context_t *context)
Delete all locations on the current device.
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.
char * dc_initiate_key_transfer(dc_context_t *context)
Initiate Autocrypt Setup Transfer.
int dc_get_blocked_cnt(dc_context_t *context)
Get the number of blocked contacts.
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.
int dc_set_config(dc_context_t *context, const char *key, const char *value)
Configure the context.
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.
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.
char * dc_msg_get_setupcodebegin(const dc_msg_t *msg)
Get the first characters of the setup code.
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.
int dc_msg_is_setupmessage(const dc_msg_t *msg)
Check if the message is an Autocrypt Setup Message.
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.
void dc_msg_force_plaintext(dc_msg_t *msg)
Force the message to be sent in plain text.
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.
Opaque object containing information about one single e-mail provider.
int dc_provider_get_status(const dc_provider_t *provider)
Whether DC works with this provider.
char * dc_provider_get_before_login_hint(const dc_provider_t *provider)
Get hints to be shown to the user on the login screen.
char * dc_provider_get_overview_page(const dc_provider_t *provider)
URL of the overview page.
dc_provider_t * dc_provider_new_from_email_with_dns(const dc_context_t *context, const char *email)
Create a provider struct for the given e-mail address by local lookup.
dc_provider_t * dc_provider_new_from_email(const dc_context_t *context, const char *email)
Create a provider struct for the given e-mail address by local lookup.
void dc_provider_unref(dc_provider_t *provider)
Free the provider info struct.