Delta Chat Core C-API
deltachat.h
1 #ifndef __DELTACHAT_H__
2 #define __DELTACHAT_H__
3 #ifdef __cplusplus
4 extern "C" {
5 #endif
6 
7 
8 #ifndef PY_CFFI
9 #include <stdint.h>
10 #include <time.h>
11 #endif
12 
13 
14 #define DC_VERSION_STR "0.43.0"
15 
16 
195 typedef struct _dc_context dc_context_t;
196 typedef struct _dc_array dc_array_t;
197 typedef struct _dc_chatlist dc_chatlist_t;
198 typedef struct _dc_chat dc_chat_t;
199 typedef struct _dc_msg dc_msg_t;
200 typedef struct _dc_contact dc_contact_t;
201 typedef struct _dc_lot dc_lot_t;
202 
203 
214 typedef uintptr_t (*dc_callback_t) (dc_context_t*, int event, uintptr_t data1, uintptr_t data2);
215 
216 
217 // create/open/config/information
218 dc_context_t* dc_context_new (dc_callback_t, void* userdata, const char* os_name);
219 void dc_context_unref (dc_context_t*);
220 void* dc_get_userdata (dc_context_t*);
221 
222 int dc_open (dc_context_t*, const char* dbfile, const char* blobdir);
223 void dc_close (dc_context_t*);
224 int dc_is_open (const dc_context_t*);
225 char* dc_get_blobdir (const dc_context_t*);
226 
227 int dc_set_config (dc_context_t*, const char* key, const char* value);
228 char* dc_get_config (dc_context_t*, const char* key);
229 char* dc_get_info (dc_context_t*);
230 char* dc_get_oauth2_url (dc_context_t*, const char* addr, const char* redirect);
231 char* dc_get_version_str (void);
232 void dc_openssl_init_not_required (void);
233 void dc_no_compound_msgs (void); // deprecated
234 
235 
236 // connect
237 void dc_configure (dc_context_t*);
238 int dc_is_configured (const dc_context_t*);
239 
240 void dc_perform_imap_jobs (dc_context_t*);
241 void dc_perform_imap_fetch (dc_context_t*);
242 void dc_perform_imap_idle (dc_context_t*);
243 void dc_interrupt_imap_idle (dc_context_t*);
244 
245 void dc_perform_mvbox_fetch (dc_context_t*);
246 void dc_perform_mvbox_idle (dc_context_t*);
247 void dc_interrupt_mvbox_idle (dc_context_t*);
248 
249 void dc_perform_sentbox_fetch (dc_context_t*);
250 void dc_perform_sentbox_idle (dc_context_t*);
251 void dc_interrupt_sentbox_idle (dc_context_t*);
252 
253 void dc_perform_smtp_jobs (dc_context_t*);
254 void dc_perform_smtp_idle (dc_context_t*);
255 void dc_interrupt_smtp_idle (dc_context_t*);
256 
257 void dc_maybe_network (dc_context_t*);
258 
259 
260 // handle chatlists
261 #define DC_GCL_ARCHIVED_ONLY 0x01
262 #define DC_GCL_NO_SPECIALS 0x02
263 #define DC_GCL_ADD_ALLDONE_HINT 0x04
264 dc_chatlist_t* dc_get_chatlist (dc_context_t*, int flags, const char* query_str, uint32_t query_id);
265 
266 
267 // handle chats
268 uint32_t dc_create_chat_by_msg_id (dc_context_t*, uint32_t msg_id);
269 uint32_t dc_create_chat_by_contact_id (dc_context_t*, uint32_t contact_id);
270 uint32_t dc_get_chat_id_by_contact_id (dc_context_t*, uint32_t contact_id);
271 
272 uint32_t dc_prepare_msg (dc_context_t*, uint32_t chat_id, dc_msg_t*);
273 uint32_t dc_send_msg (dc_context_t*, uint32_t chat_id, dc_msg_t*);
274 uint32_t dc_send_text_msg (dc_context_t*, uint32_t chat_id, const char* text_to_send);
275 void dc_set_draft (dc_context_t*, uint32_t chat_id, dc_msg_t*);
276 dc_msg_t* dc_get_draft (dc_context_t*, uint32_t chat_id);
277 
278 #define DC_GCM_ADDDAYMARKER 0x01
279 dc_array_t* dc_get_chat_msgs (dc_context_t*, uint32_t chat_id, uint32_t flags, uint32_t marker1before);
280 int dc_get_msg_cnt (dc_context_t*, uint32_t chat_id);
281 int dc_get_fresh_msg_cnt (dc_context_t*, uint32_t chat_id);
282 dc_array_t* dc_get_fresh_msgs (dc_context_t*);
283 void dc_marknoticed_chat (dc_context_t*, uint32_t chat_id);
284 void dc_marknoticed_all_chats (dc_context_t*);
285 dc_array_t* dc_get_chat_media (dc_context_t*, uint32_t chat_id, int msg_type, int or_msg_type2, int or_msg_type3);
286 uint32_t dc_get_next_media (dc_context_t*, uint32_t msg_id, int dir, int msg_type, int or_msg_type2, int or_msg_type3);
287 
288 void dc_archive_chat (dc_context_t*, uint32_t chat_id, int archive);
289 void dc_delete_chat (dc_context_t*, uint32_t chat_id);
290 
291 dc_array_t* dc_get_chat_contacts (dc_context_t*, uint32_t chat_id);
292 dc_array_t* dc_search_msgs (dc_context_t*, uint32_t chat_id, const char* query);
293 
294 dc_chat_t* dc_get_chat (dc_context_t*, uint32_t chat_id);
295 
296 
297 // handle group chats
298 uint32_t dc_create_group_chat (dc_context_t*, int verified, const char* name);
299 int dc_is_contact_in_chat (dc_context_t*, uint32_t chat_id, uint32_t contact_id);
300 int dc_add_contact_to_chat (dc_context_t*, uint32_t chat_id, uint32_t contact_id);
301 int dc_remove_contact_from_chat (dc_context_t*, uint32_t chat_id, uint32_t contact_id);
302 int dc_set_chat_name (dc_context_t*, uint32_t chat_id, const char* name);
303 int dc_set_chat_profile_image (dc_context_t*, uint32_t chat_id, const char* image);
304 
305 
306 // handle messages
307 char* dc_get_msg_info (dc_context_t*, uint32_t msg_id);
308 char* dc_get_mime_headers (dc_context_t*, uint32_t msg_id);
309 void dc_delete_msgs (dc_context_t*, const uint32_t* msg_ids, int msg_cnt);
310 void dc_forward_msgs (dc_context_t*, const uint32_t* msg_ids, int msg_cnt, uint32_t chat_id);
311 void dc_marknoticed_contact (dc_context_t*, uint32_t contact_id);
312 void dc_markseen_msgs (dc_context_t*, const uint32_t* msg_ids, int msg_cnt);
313 void dc_star_msgs (dc_context_t*, const uint32_t* msg_ids, int msg_cnt, int star);
314 dc_msg_t* dc_get_msg (dc_context_t*, uint32_t msg_id);
315 
316 
317 // handle contacts
318 int dc_may_be_valid_addr (const char* addr);
319 uint32_t dc_lookup_contact_id_by_addr (dc_context_t*, const char* addr);
320 uint32_t dc_create_contact (dc_context_t*, const char* name, const char* addr);
321 int dc_add_address_book (dc_context_t*, const char*);
322 
323 #define DC_GCL_VERIFIED_ONLY 0x01
324 #define DC_GCL_ADD_SELF 0x02
325 dc_array_t* dc_get_contacts (dc_context_t*, uint32_t flags, const char* query);
326 
327 int dc_get_blocked_cnt (dc_context_t*);
328 dc_array_t* dc_get_blocked_contacts (dc_context_t*);
329 void dc_block_contact (dc_context_t*, uint32_t contact_id, int block);
330 char* dc_get_contact_encrinfo (dc_context_t*, uint32_t contact_id);
331 int dc_delete_contact (dc_context_t*, uint32_t contact_id);
332 dc_contact_t* dc_get_contact (dc_context_t*, uint32_t contact_id);
333 
334 
335 // import/export and tools
336 #define DC_IMEX_EXPORT_SELF_KEYS 1 // param1 is a directory where the keys are written to
337 #define DC_IMEX_IMPORT_SELF_KEYS 2 // param1 is a directory where the keys are searched in and read from
338 #define DC_IMEX_EXPORT_BACKUP 11 // param1 is a directory where the backup is written to
339 #define DC_IMEX_IMPORT_BACKUP 12 // param1 is the file with the backup to import
340 void dc_imex (dc_context_t*, int what, const char* param1, const char* param2);
341 char* dc_imex_has_backup (dc_context_t*, const char* dir);
342 int dc_check_password (dc_context_t*, const char* pw);
343 char* dc_initiate_key_transfer (dc_context_t*);
344 int dc_continue_key_transfer (dc_context_t*, uint32_t msg_id, const char* setup_code);
345 void dc_stop_ongoing_process (dc_context_t*);
346 
347 
348 // out-of-band verification
349 #define DC_QR_ASK_VERIFYCONTACT 200 // id=contact
350 #define DC_QR_ASK_VERIFYGROUP 202 // text1=groupname
351 #define DC_QR_FPR_OK 210 // id=contact
352 #define DC_QR_FPR_MISMATCH 220 // id=contact
353 #define DC_QR_FPR_WITHOUT_ADDR 230 // test1=formatted fingerprint
354 #define DC_QR_ADDR 320 // id=contact
355 #define DC_QR_TEXT 330 // text1=text
356 #define DC_QR_URL 332 // text1=URL
357 #define DC_QR_ERROR 400 // text1=error string
358 dc_lot_t* dc_check_qr (dc_context_t*, const char* qr);
359 char* dc_get_securejoin_qr (dc_context_t*, uint32_t chat_id);
360 uint32_t dc_join_securejoin (dc_context_t*, const char* qr);
361 
362 
363 // location streaming
364 void dc_send_locations_to_chat (dc_context_t*, uint32_t chat_id, int seconds);
365 int dc_is_sending_locations_to_chat (dc_context_t*, uint32_t chat_id);
366 int dc_set_location (dc_context_t*, double latitude, double longitude, double accuracy);
367 dc_array_t* dc_get_locations (dc_context_t*, uint32_t chat_id, uint32_t contact_id, time_t timestamp_begin, time_t timestamp_end);
368 void dc_delete_all_locations (dc_context_t*);
369 
370 
379 void dc_array_unref (dc_array_t*);
380 
381 void dc_array_add_uint (dc_array_t*, uintptr_t);
382 void dc_array_add_id (dc_array_t*, uint32_t);
383 void dc_array_add_ptr (dc_array_t*, void*);
384 
385 size_t dc_array_get_cnt (const dc_array_t*);
386 uintptr_t dc_array_get_uint (const dc_array_t*, size_t index);
387 uint32_t dc_array_get_id (const dc_array_t*, size_t index);
388 void* dc_array_get_ptr (const dc_array_t*, size_t index);
389 double dc_array_get_latitude (const dc_array_t*, size_t index);
390 double dc_array_get_longitude (const dc_array_t*, size_t index);
391 double dc_array_get_accuracy (const dc_array_t*, size_t index);
392 time_t dc_array_get_timestamp (const dc_array_t*, size_t index);
393 uint32_t dc_array_get_chat_id (const dc_array_t*, size_t index);
394 uint32_t dc_array_get_contact_id (const dc_array_t*, size_t index);
395 uint32_t dc_array_get_msg_id (const dc_array_t*, size_t index);
396 char* dc_array_get_marker (const dc_array_t*, size_t index);
397 int dc_array_is_independent (const dc_array_t*, size_t index);
398 
399 int dc_array_search_id (const dc_array_t*, uint32_t needle, size_t* indx);
400 const uintptr_t* dc_array_get_raw (const dc_array_t*);
401 
402 
441 dc_chatlist_t* dc_chatlist_new (dc_context_t*);
442 void dc_chatlist_empty (dc_chatlist_t*);
444 size_t dc_chatlist_get_cnt (const dc_chatlist_t*);
445 uint32_t dc_chatlist_get_chat_id (const dc_chatlist_t*, size_t index);
446 uint32_t dc_chatlist_get_msg_id (const dc_chatlist_t*, size_t index);
447 dc_lot_t* dc_chatlist_get_summary (const dc_chatlist_t*, size_t index, dc_chat_t*);
448 dc_context_t* dc_chatlist_get_context (dc_chatlist_t*);
449 
450 
459 #define DC_CHAT_ID_DEADDROP 1 // virtual chat showing all messages belonging to chats flagged with chats.blocked=2
460 #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)
461 #define DC_CHAT_ID_MSGS_IN_CREATION 4 // a message is just in creation but not yet assigned to a chat (eg. we may need the message ID to set up blobs; this avoids unready message to be sent and shown)
462 #define DC_CHAT_ID_STARRED 5 // virtual chat showing all messages flagged with msgs.starred=2
463 #define DC_CHAT_ID_ARCHIVED_LINK 6 // only an indicator in a chatlist
464 #define DC_CHAT_ID_ALLDONE_HINT 7 // only an indicator in a chatlist
465 #define DC_CHAT_ID_LAST_SPECIAL 9 // larger chat IDs are "real" chats, their messages are "real" messages.
466 
467 
468 #define DC_CHAT_TYPE_UNDEFINED 0
469 #define DC_CHAT_TYPE_SINGLE 100
470 #define DC_CHAT_TYPE_GROUP 120
471 #define DC_CHAT_TYPE_VERIFIED_GROUP 130
472 
473 
474 dc_chat_t* dc_chat_new (dc_context_t*);
475 void dc_chat_empty (dc_chat_t*);
476 void dc_chat_unref (dc_chat_t*);
477 
478 uint32_t dc_chat_get_id (const dc_chat_t*);
479 int dc_chat_get_type (const dc_chat_t*);
480 char* dc_chat_get_name (const dc_chat_t*);
481 char* dc_chat_get_subtitle (const dc_chat_t*);
482 char* dc_chat_get_profile_image (const dc_chat_t*);
483 uint32_t dc_chat_get_color (const dc_chat_t*);
484 int dc_chat_get_archived (const dc_chat_t*);
485 int dc_chat_is_unpromoted (const dc_chat_t*);
486 int dc_chat_is_self_talk (const dc_chat_t*);
487 int dc_chat_is_verified (const dc_chat_t*);
489 
490 
498 #define DC_MSG_ID_MARKER1 1
499 #define DC_MSG_ID_DAYMARKER 9
500 #define DC_MSG_ID_LAST_SPECIAL 9
501 
502 
503 #define DC_STATE_UNDEFINED 0
504 #define DC_STATE_IN_FRESH 10
505 #define DC_STATE_IN_NOTICED 13
506 #define DC_STATE_IN_SEEN 16
507 #define DC_STATE_OUT_PREPARING 18
508 #define DC_STATE_OUT_DRAFT 19
509 #define DC_STATE_OUT_PENDING 20
510 #define DC_STATE_OUT_FAILED 24
511 #define DC_STATE_OUT_DELIVERED 26 // to check if a mail was sent, use dc_msg_is_sent()
512 #define DC_STATE_OUT_MDN_RCVD 28
513 
514 
515 #define DC_MAX_GET_TEXT_LEN 30000 // approx. max. lenght returned by dc_msg_get_text()
516 #define DC_MAX_GET_INFO_LEN 100000 // approx. max. lenght returned by dc_get_msg_info()
517 
518 
519 dc_msg_t* dc_msg_new (dc_context_t*, int viewtype);
520 void dc_msg_unref (dc_msg_t*);
521 void dc_msg_empty (dc_msg_t*);
522 uint32_t dc_msg_get_id (const dc_msg_t*);
523 uint32_t dc_msg_get_from_id (const dc_msg_t*);
524 uint32_t dc_msg_get_chat_id (const dc_msg_t*);
525 int dc_msg_get_viewtype (const dc_msg_t*);
526 int dc_msg_get_state (const dc_msg_t*);
527 time_t dc_msg_get_timestamp (const dc_msg_t*);
529 time_t dc_msg_get_sort_timestamp (const dc_msg_t*);
530 char* dc_msg_get_text (const dc_msg_t*);
531 char* dc_msg_get_file (const dc_msg_t*);
532 char* dc_msg_get_filename (const dc_msg_t*);
533 char* dc_msg_get_filemime (const dc_msg_t*);
534 uint64_t dc_msg_get_filebytes (const dc_msg_t*);
535 int dc_msg_get_width (const dc_msg_t*);
536 int dc_msg_get_height (const dc_msg_t*);
537 int dc_msg_get_duration (const dc_msg_t*);
538 int dc_msg_get_showpadlock (const dc_msg_t*);
540 char* dc_msg_get_summarytext (const dc_msg_t*, int approx_characters);
542 int dc_msg_has_location (const dc_msg_t*);
543 int dc_msg_is_sent (const dc_msg_t*);
544 int dc_msg_is_starred (const dc_msg_t*);
545 int dc_msg_is_forwarded (const dc_msg_t*);
546 int dc_msg_is_info (const dc_msg_t*);
547 int dc_msg_is_increation (const dc_msg_t*);
548 int dc_msg_is_setupmessage (const dc_msg_t*);
549 char* dc_msg_get_setupcodebegin (const dc_msg_t*);
550 void dc_msg_set_text (dc_msg_t*, const char* text);
551 void dc_msg_set_file (dc_msg_t*, const char* file, const char* filemime);
552 void dc_msg_set_dimension (dc_msg_t*, int width, int height);
553 void dc_msg_set_duration (dc_msg_t*, int duration);
554 void dc_msg_set_location (dc_msg_t*, double latitude, double longitude);
555 void dc_msg_latefiling_mediasize (dc_msg_t*, int width, int height, int duration);
556 
557 
577 #define DC_CONTACT_ID_SELF 1
578 #define DC_CONTACT_ID_DEVICE 2
579 #define DC_CONTACT_ID_LAST_SPECIAL 9
580 
581 
582 dc_contact_t* dc_contact_new (dc_context_t*);
583 void dc_contact_empty (dc_contact_t*);
585 uint32_t dc_contact_get_id (const dc_contact_t*);
586 char* dc_contact_get_addr (const dc_contact_t*);
587 char* dc_contact_get_name (const dc_contact_t*);
592 uint32_t dc_contact_get_color (const dc_contact_t*);
595 
596 
607 #define DC_TEXT1_DRAFT 1
608 #define DC_TEXT1_USERNAME 2
609 #define DC_TEXT1_SELF 3
610 
611 
612 dc_lot_t* dc_lot_new ();
613 void dc_lot_empty (dc_lot_t*);
614 void dc_lot_unref (dc_lot_t*);
615 char* dc_lot_get_text1 (const dc_lot_t*);
616 char* dc_lot_get_text2 (const dc_lot_t*);
618 int dc_lot_get_state (const dc_lot_t*);
619 uint32_t dc_lot_get_id (const dc_lot_t*);
620 time_t dc_lot_get_timestamp (const dc_lot_t*);
621 
622 
649 #define DC_MSG_TEXT 10
650 
651 
658 #define DC_MSG_IMAGE 20
659 
660 
666 #define DC_MSG_GIF 21
667 
668 
674 #define DC_MSG_AUDIO 40
675 
676 
683 #define DC_MSG_VOICE 41
684 
685 
694 #define DC_MSG_VIDEO 50
695 
696 
702 #define DC_MSG_FILE 60
703 
727 #define DC_LP_AUTH_OAUTH2 0x2
728 
729 
734 #define DC_LP_AUTH_NORMAL 0x4
735 
736 
741 #define DC_LP_IMAP_SOCKET_STARTTLS 0x100
742 
743 
748 #define DC_LP_IMAP_SOCKET_SSL 0x200
749 
750 
755 #define DC_LP_IMAP_SOCKET_PLAIN 0x400
756 
757 
762 #define DC_LP_SMTP_SOCKET_STARTTLS 0x10000
763 
764 
769 #define DC_LP_SMTP_SOCKET_SSL 0x20000
770 
771 
776 #define DC_LP_SMTP_SOCKET_PLAIN 0x40000
777 
778 
782 #define DC_LP_AUTH_FLAGS (DC_LP_AUTH_OAUTH2|DC_LP_AUTH_NORMAL) // if none of these flags are set, the default is choosen
783 #define DC_LP_IMAP_SOCKET_FLAGS (DC_LP_IMAP_SOCKET_STARTTLS|DC_LP_IMAP_SOCKET_SSL|DC_LP_IMAP_SOCKET_PLAIN) // if none of these flags are set, the default is choosen
784 #define DC_LP_SMTP_SOCKET_FLAGS (DC_LP_SMTP_SOCKET_STARTTLS|DC_LP_SMTP_SOCKET_SSL|DC_LP_SMTP_SOCKET_PLAIN) // if none of these flags are set, the default is choosen
785 
786 
787 
812 #define DC_EVENT_INFO 100
813 
814 
823 #define DC_EVENT_SMTP_CONNECTED 101
824 
825 
834 #define DC_EVENT_IMAP_CONNECTED 102
835 
844 #define DC_EVENT_SMTP_MESSAGE_SENT 103
845 
846 
858 #define DC_EVENT_WARNING 300
859 
860 
880 #define DC_EVENT_ERROR 400
881 
882 
904 #define DC_EVENT_ERROR_NETWORK 401
905 
906 
920 #define DC_EVENT_ERROR_SELF_NOT_IN_GROUP 410
921 
922 
934 #define DC_EVENT_MSGS_CHANGED 2000
935 
936 
947 #define DC_EVENT_INCOMING_MSG 2005
948 
949 
958 #define DC_EVENT_MSG_DELIVERED 2010
959 
960 
969 #define DC_EVENT_MSG_FAILED 2012
970 
971 
980 #define DC_EVENT_MSG_READ 2015
981 
982 
993 #define DC_EVENT_CHAT_MODIFIED 2020
994 
995 
1003 #define DC_EVENT_CONTACTS_CHANGED 2030
1004 
1005 
1006 
1016 #define DC_EVENT_LOCATION_CHANGED 2035
1017 
1018 
1026 #define DC_EVENT_CONFIGURE_PROGRESS 2041
1027 
1028 
1036 #define DC_EVENT_IMEX_PROGRESS 2051
1037 
1038 
1051 #define DC_EVENT_IMEX_FILE_WRITTEN 2052
1052 
1053 
1069 #define DC_EVENT_SECUREJOIN_INVITER_PROGRESS 2060
1070 
1071 
1085 #define DC_EVENT_SECUREJOIN_JOINER_PROGRESS 2061
1086 
1087 
1088 // the following events are functions that should be provided by the frontends
1089 
1090 
1103 #define DC_EVENT_GET_STRING 2091
1104 
1105 
1120 #define DC_EVENT_HTTP_GET 2100
1121 
1122 
1138 #define DC_EVENT_HTTP_POST 2110
1139 
1140 
1145 #define DC_EVENT_FILE_COPIED 2055 // deprecated
1146 #define DC_EVENT_IS_OFFLINE 2081 // deprecated
1147 #define DC_ERROR_SEE_STRING 0 // deprecated
1148 #define DC_ERROR_SELF_NOT_IN_GROUP 1 // deprecated
1149 #define DC_STR_SELFNOTINGRP 21 // deprecated
1150 #define DC_EVENT_DATA1_IS_STRING(e) ((e)==DC_EVENT_HTTP_GET || (e)==DC_EVENT_IMEX_FILE_WRITTEN || (e)==DC_EVENT_FILE_COPIED)
1151 #define DC_EVENT_DATA2_IS_STRING(e) ((e)>=100 && (e)<=499)
1152 #define DC_EVENT_RETURNS_INT(e) ((e)==DC_EVENT_IS_OFFLINE)
1153 #define DC_EVENT_RETURNS_STRING(e) ((e)==DC_EVENT_GET_STRING || (e)==DC_EVENT_HTTP_GET)
1154 
1155 
1156 /*
1157  * Values for dc_get|set_config("show_emails")
1158  */
1159 #define DC_SHOW_EMAILS_OFF 0
1160 #define DC_SHOW_EMAILS_ACCEPTED_CONTACTS 1
1161 #define DC_SHOW_EMAILS_ALL 2
1162 
1163 
1164 /*
1165  * TODO: Strings need some doumentation about used placeholders.
1166  *
1167  * @defgroup DC_STR DC_STR
1168  *
1169  * These constants are used to request strings using #DC_EVENT_GET_STRING.
1170  *
1171  * @addtogroup DC_STR
1172  * @{
1173  */
1174 #define DC_STR_NOMESSAGES 1
1175 #define DC_STR_SELF 2
1176 #define DC_STR_DRAFT 3
1177 #define DC_STR_MEMBER 4
1178 #define DC_STR_CONTACT 6
1179 #define DC_STR_VOICEMESSAGE 7
1180 #define DC_STR_DEADDROP 8
1181 #define DC_STR_IMAGE 9
1182 #define DC_STR_VIDEO 10
1183 #define DC_STR_AUDIO 11
1184 #define DC_STR_FILE 12
1185 #define DC_STR_STATUSLINE 13
1186 #define DC_STR_NEWGROUPDRAFT 14
1187 #define DC_STR_MSGGRPNAME 15
1188 #define DC_STR_MSGGRPIMGCHANGED 16
1189 #define DC_STR_MSGADDMEMBER 17
1190 #define DC_STR_MSGDELMEMBER 18
1191 #define DC_STR_MSGGROUPLEFT 19
1192 #define DC_STR_GIF 23
1193 #define DC_STR_ENCRYPTEDMSG 24
1194 #define DC_STR_E2E_AVAILABLE 25
1195 #define DC_STR_ENCR_TRANSP 27
1196 #define DC_STR_ENCR_NONE 28
1197 #define DC_STR_CANTDECRYPT_MSG_BODY 29
1198 #define DC_STR_FINGERPRINTS 30
1199 #define DC_STR_READRCPT 31
1200 #define DC_STR_READRCPT_MAILBODY 32
1201 #define DC_STR_MSGGRPIMGDELETED 33
1202 #define DC_STR_E2E_PREFERRED 34
1203 #define DC_STR_CONTACT_VERIFIED 35
1204 #define DC_STR_CONTACT_NOT_VERIFIED 36
1205 #define DC_STR_CONTACT_SETUP_CHANGED 37
1206 #define DC_STR_ARCHIVEDCHATS 40
1207 #define DC_STR_STARREDMSGS 41
1208 #define DC_STR_AC_SETUP_MSG_SUBJECT 42
1209 #define DC_STR_AC_SETUP_MSG_BODY 43
1210 #define DC_STR_SELFTALK_SUBTITLE 50
1211 #define DC_STR_CANNOT_LOGIN 60
1212 #define DC_STR_SERVER_RESPONSE 61
1213 #define DC_STR_MSGACTIONBYUSER 62
1214 #define DC_STR_MSGACTIONBYME 63
1215 #define DC_STR_MSGLOCATIONENABLED 64
1216 #define DC_STR_MSGLOCATIONDISABLED 65
1217 #define DC_STR_LOCATION 66
1218 #define DC_STR_COUNT 66
1219 
1220 /*
1221  * @}
1222  */
1223 
1224 
1225 #ifdef __cplusplus
1226 }
1227 #endif
1228 #endif // __DELTACHAT_H__
dc_context_t * dc_chatlist_get_context(dc_chatlist_t *chatlist)
Helper function to get the associated context object.
Definition: dc_chatlist.c:228
dc_array_t * dc_get_fresh_msgs(dc_context_t *context)
Returns the message IDs of all fresh messages of any chat.
Definition: dc_context.c:919
char * dc_get_contact_encrinfo(dc_context_t *context, uint32_t contact_id)
Get encryption info for a contact.
Definition: dc_contact.c:1315
void dc_perform_mvbox_idle(dc_context_t *context)
Wait for messages or jobs in the MVBOX-thread.
Definition: dc_job.c:1013
time_t dc_array_get_timestamp(const dc_array_t *array, size_t index)
Return the timestamp of the item at the given index.
Definition: dc_array.c:387
int dc_chat_is_verified(const dc_chat_t *chat)
Check if a chat is verified.
Definition: dc_chat.c:365
uint32_t dc_prepare_msg(dc_context_t *context, uint32_t chat_id, dc_msg_t *msg)
Prepare a message for sending.
Definition: dc_chat.c:2572
int dc_msg_is_setupmessage(const dc_msg_t *msg)
Check if the message is an Autocrypt Setup Message.
Definition: dc_msg.c:774
dc_array_t * dc_search_msgs(dc_context_t *context, uint32_t chat_id, const char *query)
Search messages containing the given query string.
Definition: dc_context.c:971
dc_array_t * dc_get_blocked_contacts(dc_context_t *context)
Get blocked contacts.
Definition: dc_contact.c:1114
time_t dc_lot_get_timestamp(const dc_lot_t *lot)
Get the associated timestamp.
Definition: dc_lot.c:169
char * dc_array_get_marker(const dc_array_t *array, size_t index)
Return the marker-character of the item at the given index.
Definition: dc_array.c:472
void dc_context_unref(dc_context_t *context)
Free a context object.
Definition: dc_context.c:241
int dc_open(dc_context_t *context, const char *dbfile, const char *blobdir)
Open context database.
Definition: dc_context.c:307
size_t dc_chatlist_get_cnt(const dc_chatlist_t *chatlist)
Find out the number of chats in a chatlist.
Definition: dc_chatlist.c:78
int dc_lot_get_state(const dc_lot_t *lot)
Get the associated state.
Definition: dc_lot.c:133
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...
Definition: dc_msg.c:742
void dc_marknoticed_chat(dc_context_t *context, uint32_t chat_id)
Mark all messages in a chat as noticed.
Definition: dc_chat.c:634
uint32_t dc_join_securejoin(dc_context_t *context, const char *qr)
Join an out-of-band-verification initiated on another device with dc_get_securejoin_qr().
Definition: dc_securejoin.c:405
uint32_t dc_msg_get_from_id(const dc_msg_t *msg)
Get the ID of contact who wrote the message.
Definition: dc_msg.c:138
int dc_msg_get_height(const dc_msg_t *msg)
Get height of image or video.
Definition: dc_msg.c:539
uint32_t dc_create_chat_by_contact_id(dc_context_t *context, uint32_t contact_id)
Create a normal chat with a single user.
Definition: dc_chat.c:774
void dc_msg_set_dimension(dc_msg_t *msg, int width, int height)
Set the dimensions associated with message object.
Definition: dc_msg.c:1148
int dc_add_contact_to_chat(dc_context_t *context, uint32_t chat_id, uint32_t contact_id)
Add a member to a group.
Definition: dc_chat.c:2083
void dc_array_unref(dc_array_t *array)
Free an array object.
Definition: dc_array.c:54
uint32_t dc_msg_get_chat_id(const dc_msg_t *msg)
Get the ID of chat the message belongs to.
Definition: dc_msg.c:157
int dc_msg_has_location(const dc_msg_t *msg)
Check if a message has a location bound to it.
Definition: dc_msg.c:326
int dc_is_configured(const dc_context_t *context)
Check if the context is already configured.
Definition: dc_configure.c:1146
int dc_msg_is_forwarded(const dc_msg_t *msg)
Check if the message is a forwarded message.
Definition: dc_msg.c:717
uint32_t dc_create_group_chat(dc_context_t *context, int verified, const char *chat_name)
Create a new group chat.
Definition: dc_chat.c:1744
void dc_interrupt_smtp_idle(dc_context_t *context)
Interrupt waiting for smtp-jobs.
Definition: dc_job.c:1235
An object representing a single chatlist in memory.
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().
Definition: dc_chat.c:401
char * dc_chat_get_profile_image(const dc_chat_t *chat)
Get the chat&#39;s profile image.
Definition: dc_chat.c:232
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.
Definition: dc_chat.c:1056
An object representing a single account.
An object representing a single contact in memory.
int dc_is_sending_locations_to_chat(dc_context_t *context, uint32_t chat_id)
Check if location streaming is enabled.
Definition: dc_location.c:660
void dc_imex(dc_context_t *context, int what, const char *param1, const char *param2)
Import/export things.
Definition: dc_imex.c:1040
void dc_star_msgs(dc_context_t *context, const uint32_t *msg_ids, int msg_cnt, int star)
Star/unstar messages by setting the last parameter to 0 (unstar) or 1 (star).
Definition: dc_msg.c:1756
char * dc_imex_has_backup(dc_context_t *context, const char *dir_name)
Check if there is a backup file.
Definition: dc_imex.c:1191
char * dc_msg_get_file(const dc_msg_t *msg)
Find out full path, file name and extension of the file associated with a message.
Definition: dc_msg.c:382
char * dc_contact_get_profile_image(const dc_contact_t *contact)
Get the contact&#39;s profile image.
Definition: dc_contact.c:225
int dc_set_chat_profile_image(dc_context_t *context, uint32_t chat_id, const char *new_image)
Set group profile image.
Definition: dc_chat.c:1880
int dc_msg_has_deviating_timestamp(const dc_msg_t *msg)
Check if a message has a deviating timestamp.
Definition: dc_msg.c:306
int dc_contact_is_blocked(const dc_contact_t *contact)
Check if a contact is blocked.
Definition: dc_contact.c:278
dc_chatlist_t * dc_get_chatlist(dc_context_t *context, int listflags, const char *query_str, uint32_t query_id)
Get a list of chats.
Definition: dc_chatlist.c:448
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.
Definition: dc_msg.c:1501
char * dc_lot_get_text1(const dc_lot_t *lot)
Get first string.
Definition: dc_lot.c:79
uint32_t dc_lookup_contact_id_by_addr(dc_context_t *context, const char *addr)
Check if an e-mail address belongs to a known and unblocked contact.
Definition: dc_contact.c:978
char * dc_lot_get_text2(const dc_lot_t *lot)
Get second string.
Definition: dc_lot.c:97
int dc_remove_contact_from_chat(dc_context_t *context, uint32_t chat_id, uint32_t contact_id)
Remove a member from a group.
Definition: dc_chat.c:2103
char * dc_get_blobdir(const dc_context_t *context)
Get the blob directory.
Definition: dc_context.c:408
uint32_t dc_msg_get_id(const dc_msg_t *msg)
Get the ID of the message.
Definition: dc_msg.c:115
char * dc_msg_get_text(const dc_msg_t *msg)
Get the text of the message.
Definition: dc_msg.c:355
void dc_perform_mvbox_fetch(dc_context_t *context)
Fetch new messages from the MVBOX, if any.
Definition: dc_job.c:989
uint64_t dc_msg_get_filebytes(const dc_msg_t *msg)
Get the size of the file.
Definition: dc_msg.c:480
int dc_msg_is_sent(const dc_msg_t *msg)
Check if a message was sent successfully.
Definition: dc_msg.c:671
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.
Definition: dc_chat.c:1273
int dc_add_address_book(dc_context_t *context, const char *adr_book)
Add a number of contacts.
Definition: dc_contact.c:891
An object containing a simple array.
uintptr_t(* dc_callback_t)(dc_context_t *, int event, uintptr_t data1, uintptr_t data2)
Callback function that should be given to dc_context_new().
Definition: deltachat.h:214
double dc_array_get_longitude(const dc_array_t *array, size_t index)
Return the longitude of the item at the given index.
Definition: dc_array.c:346
int dc_chat_get_type(const dc_chat_t *chat)
Get chat type.
Definition: dc_chat.c:130
void dc_block_contact(dc_context_t *context, uint32_t contact_id, int new_blocking)
Block or unblock a contact.
Definition: dc_contact.c:1233
void dc_perform_smtp_jobs(dc_context_t *context)
Execute pending smtp-jobs.
Definition: dc_job.c:1148
uint32_t dc_contact_get_id(const dc_contact_t *contact)
Get the ID of the contact.
Definition: dc_contact.c:92
void dc_chat_unref(dc_chat_t *chat)
Free a chat object.
Definition: dc_chat.c:45
int dc_lot_get_text1_meaning(const dc_lot_t *lot)
Get the meaning of the first string.
Definition: dc_lot.c:115
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.
Definition: dc_array.c:447
An object representing a single chat in memory.
char * dc_contact_get_first_name(const dc_contact_t *contact)
Get the part of the name before the first space.
Definition: dc_contact.c:200
char * dc_get_info(dc_context_t *context)
Get information about the context.
Definition: dc_context.c:735
An object representing a single message in memory.
void * dc_array_get_ptr(const dc_array_t *array, size_t index)
Get the item at the given index as an ID.
Definition: dc_array.c:307
dc_context_t * dc_context_new(dc_callback_t cb, void *userdata, const char *os_name)
Create a new context object.
Definition: dc_context.c:181
int dc_msg_is_increation(const dc_msg_t *msg)
Check if a message is still in creation.
Definition: dc_msg.c:1070
void dc_perform_sentbox_idle(dc_context_t *context)
Wait for messages or jobs in the SENTBOX-thread.
Definition: dc_job.c:1084
dc_msg_t * dc_get_draft(dc_context_t *context, uint32_t chat_id)
Get draft for a chat, if any.
Definition: dc_chat.c:1297
int dc_is_open(const dc_context_t *context)
Check if the context database is open.
Definition: dc_context.c:390
uint32_t dc_get_next_media(dc_context_t *context, uint32_t curr_msg_id, int dir, int msg_type, int msg_type2, int msg_type3)
Search next/previous message based on a given message and a list of types.
Definition: dc_chat.c:938
char * dc_get_msg_info(dc_context_t *context, uint32_t msg_id)
Get an informational text for a single message.
Definition: dc_msg.c:1539
int dc_may_be_valid_addr(const char *addr)
Rough check if a string may be a valid e-mail address.
Definition: dc_contact.c:946
int dc_set_location(dc_context_t *context, double latitude, double longitude, double accuracy)
Set current location.
Definition: dc_location.c:716
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.
Definition: dc_array.c:407
void dc_interrupt_mvbox_idle(dc_context_t *context)
Interrupt waiting for MVBOX-fetch.
Definition: dc_job.c:1039
void dc_chatlist_unref(dc_chatlist_t *chatlist)
Free a chatlist object.
Definition: dc_chatlist.c:40
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.
Definition: dc_chat.c:2753
uint32_t dc_chat_get_id(const dc_chat_t *chat)
Get chat ID.
Definition: dc_chat.c:101
int dc_msg_get_duration(const dc_msg_t *msg)
Get the duration of audio or video.
Definition: dc_msg.c:559
char * dc_msg_get_filename(const dc_msg_t *msg)
Get base file name without path.
Definition: dc_msg.c:411
int dc_msg_get_viewtype(const dc_msg_t *msg)
Get the type of the message.
Definition: dc_msg.c:174
uintptr_t dc_array_get_uint(const dc_array_t *array, size_t index)
Get the item at the given index as an unsigned integer.
Definition: dc_array.c:267
void dc_interrupt_sentbox_idle(dc_context_t *context)
Interrupt waiting for messages or jobs in the SENTBOX-thread.
Definition: dc_job.c:1102
uint32_t dc_array_get_id(const dc_array_t *array, size_t index)
Get the item at the given index as an ID.
Definition: dc_array.c:285
void * dc_get_userdata(dc_context_t *context)
Get user data associated with a context object.
Definition: dc_context.c:283
void dc_openssl_init_not_required(void)
Skip OpenSSL initialisation.
Definition: dc_openssl.c:30
void dc_perform_imap_idle(dc_context_t *context)
Wait for messages or jobs.
Definition: dc_job.c:879
char * dc_chat_get_name(const dc_chat_t *chat)
Get name of a chat.
Definition: dc_chat.c:152
int dc_contact_is_verified(dc_contact_t *contact)
Check if a contact was verified.
Definition: dc_contact.c:335
time_t dc_msg_get_sort_timestamp(const dc_msg_t *msg)
Get message time used for sorting.
Definition: dc_msg.c:282
void dc_delete_chat(dc_context_t *context, uint32_t chat_id)
Delete a chat.
Definition: dc_chat.c:1599
void dc_perform_imap_fetch(dc_context_t *context)
Fetch new messages, if any.
Definition: dc_job.c:839
void dc_markseen_msgs(dc_context_t *context, const uint32_t *msg_ids, int msg_cnt)
Mark a message as seen, updates the IMAP state and sends MDNs.
Definition: dc_msg.c:1871
dc_chat_t * dc_get_chat(dc_context_t *context, uint32_t chat_id)
Get chat object by a chat ID.
Definition: dc_chat.c:594
char * dc_msg_get_filemime(const dc_msg_t *msg)
Get mime type of the file.
Definition: dc_msg.c:442
int dc_msg_get_state(const dc_msg_t *msg)
Get the state of a message.
Definition: dc_msg.c:213
char * dc_chat_get_subtitle(const dc_chat_t *chat)
Get a subtitle for a chat.
Definition: dc_chat.c:172
dc_array_t * dc_get_contacts(dc_context_t *context, uint32_t listflags, const char *query)
Returns known and unblocked contacts.
Definition: dc_contact.c:1032
void dc_msg_set_duration(dc_msg_t *msg, int duration)
Set the duration associated with message object.
Definition: dc_msg.c:1168
dc_lot_t * dc_msg_get_summary(const dc_msg_t *msg, const dc_chat_t *chat)
Get a summary for a message.
Definition: dc_msg.c:611
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.
Definition: dc_contact.c:843
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.
Definition: dc_chat.c:1960
char * dc_initiate_key_transfer(dc_context_t *context)
Initiate Autocrypt Setup Transfer.
Definition: dc_imex.c:347
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.
Definition: dc_chat.c:2687
dc_msg_t * dc_msg_new(dc_context_t *context, int viewtype)
Create new message object.
Definition: dc_msg.c:23
void dc_marknoticed_contact(dc_context_t *context, uint32_t contact_id)
Mark all messages sent by the given contact as noticed.
Definition: dc_contact.c:1176
size_t dc_array_get_cnt(const dc_array_t *array)
Find out the number of items in an array.
Definition: dc_array.c:248
time_t dc_msg_get_received_timestamp(const dc_msg_t *msg)
Get message receive time.
Definition: dc_msg.c:259
char * dc_contact_get_addr(const dc_contact_t *contact)
Get email address.
Definition: dc_contact.c:108
void dc_close(dc_context_t *context)
Close context database opened by dc_open().
Definition: dc_context.c:360
char * dc_get_config(dc_context_t *context, const char *key)
Get a configuration option.
Definition: dc_context.c:606
void dc_interrupt_imap_idle(dc_context_t *context)
Interrupt waiting for imap-jobs.
Definition: dc_job.c:930
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.
Definition: dc_chat.c:2614
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.
Definition: dc_chatlist.c:156
int dc_msg_get_showpadlock(const dc_msg_t *msg)
Check if a padlock should be shown beside the message.
Definition: dc_msg.c:575
char * dc_msg_get_setupcodebegin(const dc_msg_t *msg)
Get the first characters of the setup code.
Definition: dc_msg.c:798
char * dc_get_mime_headers(dc_context_t *context, uint32_t msg_id)
Get the raw mime-headers of the given message.
Definition: dc_msg.c:1722
uint32_t dc_chatlist_get_msg_id(const dc_chatlist_t *chatlist, size_t index)
Get a single message ID of a chatlist.
Definition: dc_chatlist.c:120
void dc_perform_sentbox_fetch(dc_context_t *context)
Fetch new messages from the Sent folder, if any.
Definition: dc_job.c:1064
uint32_t dc_create_chat_by_msg_id(dc_context_t *context, uint32_t msg_id)
Create a normal chat or a group chat by a messages ID that comes typically from the deaddrop...
Definition: dc_chat.c:839
void dc_delete_msgs(dc_context_t *context, const uint32_t *msg_ids, int msg_cnt)
Delete messages.
Definition: dc_msg.c:1829
int dc_chat_is_unpromoted(const dc_chat_t *chat)
Check if a group chat is still unpromoted.
Definition: dc_chat.c:347
int dc_get_msg_cnt(dc_context_t *context, uint32_t chat_id)
Get the total number of messages in a chat.
Definition: dc_chat.c:1434
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.
Definition: dc_chat.c:718
int dc_get_blocked_cnt(dc_context_t *context)
Get the number of blocked contacts.
Definition: dc_contact.c:1199
char * dc_get_securejoin_qr(dc_context_t *context, uint32_t group_chat_id)
Get QR code text that will offer an secure-join verification.
Definition: dc_securejoin.c:302
char * dc_contact_get_name(const dc_contact_t *contact)
Get the contact name.
Definition: dc_contact.c:129
int dc_msg_is_starred(const dc_msg_t *msg)
Check if a message is starred.
Definition: dc_msg.c:692
uint32_t dc_chatlist_get_chat_id(const dc_chatlist_t *chatlist, size_t index)
Get a single chat ID of a chatlist.
Definition: dc_chatlist.c:99
char * dc_get_oauth2_url(dc_context_t *context, const char *addr, const char *redirect_uri)
Get url that can be used to initiate an OAuth2 authorisation.
Definition: dc_oauth2.c:161
dc_lot_t * dc_check_qr(dc_context_t *context, const char *qr)
Check a scanned QR code.
Definition: dc_qr.c:37
void dc_msg_set_location(dc_msg_t *msg, double latitude, double longitude)
Set any location that should be bound to the message object.
Definition: dc_msg.c:1194
int dc_chat_get_archived(const dc_chat_t *chat)
Get archived state.
Definition: dc_chat.c:318
int dc_msg_get_width(const dc_msg_t *msg)
Get width of image or video.
Definition: dc_msg.c:516
uint32_t dc_lot_get_id(const dc_lot_t *lot)
Get the associated ID.
Definition: dc_lot.c:149
void dc_marknoticed_all_chats(dc_context_t *context)
Same as dc_marknoticed_chat() but for all chats.
Definition: dc_chat.c:678
An object containing a set of values.
double dc_array_get_latitude(const dc_array_t *array, size_t index)
Return the latitude of the item at the given index.
Definition: dc_array.c:326
void dc_msg_set_text(dc_msg_t *msg, const char *text)
Set the text of a message object.
Definition: dc_msg.c:1104
void dc_perform_imap_jobs(dc_context_t *context)
Execute pending imap-jobs.
Definition: dc_job.c:811
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.
Definition: dc_array.c:427
dc_array_t * dc_get_chat_media(dc_context_t *context, uint32_t chat_id, int msg_type, int msg_type2, int msg_type3)
Returns all message IDs of the given types in a chat.
Definition: dc_chat.c:892
dc_array_t * dc_get_chat_contacts(dc_context_t *context, uint32_t chat_id)
Get contact IDs belonging to a chat.
Definition: dc_chat.c:1006
time_t dc_msg_get_timestamp(const dc_msg_t *msg)
Get message sending time.
Definition: dc_msg.c:238
int dc_get_fresh_msg_cnt(dc_context_t *context, uint32_t chat_id)
Get the number of fresh messages in a chat.
Definition: dc_chat.c:1477
void dc_archive_chat(dc_context_t *context, uint32_t chat_id, int archive)
Archive or unarchive a chat.
Definition: dc_chat.c:1524
double dc_array_get_accuracy(const dc_array_t *array, size_t index)
Return the accuracy of the item at the given index.
Definition: dc_array.c:367
uint32_t dc_chat_get_color(const dc_chat_t *chat)
Get a color for the chat.
Definition: dc_chat.c:275
dc_contact_t * dc_get_contact(dc_context_t *context, uint32_t contact_id)
Get a single contact object.
Definition: dc_contact.c:1151
char * dc_contact_get_name_n_addr(const dc_contact_t *contact)
Get a summary of name and address.
Definition: dc_contact.c:177
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.
Definition: dc_imex.c:516
void dc_maybe_network(dc_context_t *context)
This function can be called whenever there is a hint that the network is available again...
Definition: dc_job.c:1268
void dc_contact_unref(dc_contact_t *contact)
Free a contact object.
Definition: dc_contact.c:42
void dc_msg_unref(dc_msg_t *msg)
Free a message object.
Definition: dc_msg.c:63
int dc_set_config(dc_context_t *context, const char *key, const char *value)
Configure the context.
Definition: dc_context.c:534
void dc_perform_smtp_idle(dc_context_t *context)
Wait for smtp-jobs.
Definition: dc_job.c:1184
const uintptr_t * dc_array_get_raw(const dc_array_t *array)
Get raw pointer to the data.
Definition: dc_array.c:543
int dc_delete_contact(dc_context_t *context, uint32_t contact_id)
Delete a contact.
Definition: dc_contact.c:1406
uint32_t dc_contact_get_color(const dc_contact_t *contact)
Get a color for the contact.
Definition: dc_contact.c:259
void dc_msg_set_file(dc_msg_t *msg, const char *file, const char *filemime)
Set the file associated with a message object.
Definition: dc_msg.c:1127
int dc_check_password(dc_context_t *context, const char *test_pw)
Check if the user is authorized by the given password in some way.
Definition: dc_imex.c:1255
int dc_chat_is_self_talk(const dc_chat_t *chat)
Check if a chat is a self talk.
Definition: dc_chat.c:382
int dc_array_is_independent(const dc_array_t *array, size_t index)
Return the independent-state of the location at the given index.
Definition: dc_array.c:493
int dc_set_chat_name(dc_context_t *context, uint32_t chat_id, const char *new_name)
Set group name.
Definition: dc_chat.c:1808
void dc_send_locations_to_chat(dc_context_t *context, uint32_t chat_id, int seconds)
Enable or disable location streaming for a chat.
Definition: dc_location.c:593
char * dc_msg_get_summarytext(const dc_msg_t *msg, int approx_characters)
Get a message summary as a single line of text.
Definition: dc_msg.c:651
void dc_lot_unref(dc_lot_t *set)
Frees an object containing a set of parameters.
Definition: dc_lot.c:32
char * dc_contact_get_display_name(const dc_contact_t *contact)
Get display name.
Definition: dc_contact.c:150
void dc_configure(dc_context_t *context)
Configure a context.
Definition: dc_configure.c:1123
void dc_delete_all_locations(dc_context_t *context)
Delete all locations on the current device.
Definition: dc_location.c:909
void dc_stop_ongoing_process(dc_context_t *context)
Signal an ongoing process to stop.
Definition: dc_configure.c:1227
void dc_msg_latefiling_mediasize(dc_msg_t *msg, int width, int height, int duration)
Late filing information to a message.
Definition: dc_msg.c:1227
dc_array_t * dc_get_locations(dc_context_t *context, uint32_t chat_id, uint32_t contact_id, time_t timestamp_from, time_t timestamp_to)
Get shared locations from the database.
Definition: dc_location.c:836