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.45.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);
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 
244 
248 
252 
256 
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);
283 void dc_marknoticed_chat (dc_context_t*, uint32_t chat_id);
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 
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);
344 int dc_continue_key_transfer (dc_context_t*, uint32_t msg_id, const char* setup_code);
346 #define DC_EMPTY_MVBOX 0x01
347 #define DC_EMPTY_INBOX 0x02
348 void dc_empty_server (dc_context_t*, int flags);
349 
350 
351 // out-of-band verification
352 #define DC_QR_ASK_VERIFYCONTACT 200 // id=contact
353 #define DC_QR_ASK_VERIFYGROUP 202 // text1=groupname
354 #define DC_QR_FPR_OK 210 // id=contact
355 #define DC_QR_FPR_MISMATCH 220 // id=contact
356 #define DC_QR_FPR_WITHOUT_ADDR 230 // test1=formatted fingerprint
357 #define DC_QR_ADDR 320 // id=contact
358 #define DC_QR_TEXT 330 // text1=text
359 #define DC_QR_URL 332 // text1=URL
360 #define DC_QR_ERROR 400 // text1=error string
361 dc_lot_t* dc_check_qr (dc_context_t*, const char* qr);
362 char* dc_get_securejoin_qr (dc_context_t*, uint32_t chat_id);
363 uint32_t dc_join_securejoin (dc_context_t*, const char* qr);
364 
365 
366 // location streaming
367 void dc_send_locations_to_chat (dc_context_t*, uint32_t chat_id, int seconds);
368 int dc_is_sending_locations_to_chat (dc_context_t*, uint32_t chat_id);
369 int dc_set_location (dc_context_t*, double latitude, double longitude, double accuracy);
370 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);
372 
373 
382 void dc_array_unref (dc_array_t*);
383 
384 void dc_array_add_uint (dc_array_t*, uintptr_t);
385 void dc_array_add_id (dc_array_t*, uint32_t);
386 void dc_array_add_ptr (dc_array_t*, void*);
387 
388 size_t dc_array_get_cnt (const dc_array_t*);
389 uintptr_t dc_array_get_uint (const dc_array_t*, size_t index);
390 uint32_t dc_array_get_id (const dc_array_t*, size_t index);
391 void* dc_array_get_ptr (const dc_array_t*, size_t index);
392 double dc_array_get_latitude (const dc_array_t*, size_t index);
393 double dc_array_get_longitude (const dc_array_t*, size_t index);
394 double dc_array_get_accuracy (const dc_array_t*, size_t index);
395 time_t dc_array_get_timestamp (const dc_array_t*, size_t index);
396 uint32_t dc_array_get_chat_id (const dc_array_t*, size_t index);
397 uint32_t dc_array_get_contact_id (const dc_array_t*, size_t index);
398 uint32_t dc_array_get_msg_id (const dc_array_t*, size_t index);
399 char* dc_array_get_marker (const dc_array_t*, size_t index);
400 int dc_array_is_independent (const dc_array_t*, size_t index);
401 
402 int dc_array_search_id (const dc_array_t*, uint32_t needle, size_t* indx);
403 const uintptr_t* dc_array_get_raw (const dc_array_t*);
404 
405 
444 dc_chatlist_t* dc_chatlist_new (dc_context_t*);
445 void dc_chatlist_empty (dc_chatlist_t*);
447 size_t dc_chatlist_get_cnt (const dc_chatlist_t*);
448 uint32_t dc_chatlist_get_chat_id (const dc_chatlist_t*, size_t index);
449 uint32_t dc_chatlist_get_msg_id (const dc_chatlist_t*, size_t index);
450 dc_lot_t* dc_chatlist_get_summary (const dc_chatlist_t*, size_t index, dc_chat_t*);
452 
453 
462 #define DC_CHAT_ID_DEADDROP 1 // virtual chat showing all messages belonging to chats flagged with chats.blocked=2
463 #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)
464 #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)
465 #define DC_CHAT_ID_STARRED 5 // virtual chat showing all messages flagged with msgs.starred=2
466 #define DC_CHAT_ID_ARCHIVED_LINK 6 // only an indicator in a chatlist
467 #define DC_CHAT_ID_ALLDONE_HINT 7 // only an indicator in a chatlist
468 #define DC_CHAT_ID_LAST_SPECIAL 9 // larger chat IDs are "real" chats, their messages are "real" messages.
469 
470 
471 #define DC_CHAT_TYPE_UNDEFINED 0
472 #define DC_CHAT_TYPE_SINGLE 100
473 #define DC_CHAT_TYPE_GROUP 120
474 #define DC_CHAT_TYPE_VERIFIED_GROUP 130
475 
476 
477 dc_chat_t* dc_chat_new (dc_context_t*);
478 void dc_chat_empty (dc_chat_t*);
479 void dc_chat_unref (dc_chat_t*);
480 
481 uint32_t dc_chat_get_id (const dc_chat_t*);
482 int dc_chat_get_type (const dc_chat_t*);
483 char* dc_chat_get_name (const dc_chat_t*);
484 char* dc_chat_get_subtitle (const dc_chat_t*);
485 char* dc_chat_get_profile_image (const dc_chat_t*);
486 uint32_t dc_chat_get_color (const dc_chat_t*);
487 int dc_chat_get_archived (const dc_chat_t*);
488 int dc_chat_is_unpromoted (const dc_chat_t*);
489 int dc_chat_is_self_talk (const dc_chat_t*);
490 int dc_chat_is_verified (const dc_chat_t*);
492 
493 
501 #define DC_MSG_ID_MARKER1 1
502 #define DC_MSG_ID_DAYMARKER 9
503 #define DC_MSG_ID_LAST_SPECIAL 9
504 
505 
506 #define DC_STATE_UNDEFINED 0
507 #define DC_STATE_IN_FRESH 10
508 #define DC_STATE_IN_NOTICED 13
509 #define DC_STATE_IN_SEEN 16
510 #define DC_STATE_OUT_PREPARING 18
511 #define DC_STATE_OUT_DRAFT 19
512 #define DC_STATE_OUT_PENDING 20
513 #define DC_STATE_OUT_FAILED 24
514 #define DC_STATE_OUT_DELIVERED 26 // to check if a mail was sent, use dc_msg_is_sent()
515 #define DC_STATE_OUT_MDN_RCVD 28
516 
517 
518 #define DC_MAX_GET_TEXT_LEN 30000 // approx. max. lenght returned by dc_msg_get_text()
519 #define DC_MAX_GET_INFO_LEN 100000 // approx. max. lenght returned by dc_get_msg_info()
520 
521 
522 dc_msg_t* dc_msg_new (dc_context_t*, int viewtype);
523 void dc_msg_unref (dc_msg_t*);
524 void dc_msg_empty (dc_msg_t*);
525 uint32_t dc_msg_get_id (const dc_msg_t*);
526 uint32_t dc_msg_get_from_id (const dc_msg_t*);
527 uint32_t dc_msg_get_chat_id (const dc_msg_t*);
528 int dc_msg_get_viewtype (const dc_msg_t*);
529 int dc_msg_get_state (const dc_msg_t*);
530 time_t dc_msg_get_timestamp (const dc_msg_t*);
532 time_t dc_msg_get_sort_timestamp (const dc_msg_t*);
533 char* dc_msg_get_text (const dc_msg_t*);
534 char* dc_msg_get_file (const dc_msg_t*);
535 char* dc_msg_get_filename (const dc_msg_t*);
536 char* dc_msg_get_filemime (const dc_msg_t*);
537 uint64_t dc_msg_get_filebytes (const dc_msg_t*);
538 int dc_msg_get_width (const dc_msg_t*);
539 int dc_msg_get_height (const dc_msg_t*);
540 int dc_msg_get_duration (const dc_msg_t*);
541 int dc_msg_get_showpadlock (const dc_msg_t*);
543 char* dc_msg_get_summarytext (const dc_msg_t*, int approx_characters);
545 int dc_msg_has_location (const dc_msg_t*);
546 int dc_msg_is_sent (const dc_msg_t*);
547 int dc_msg_is_starred (const dc_msg_t*);
548 int dc_msg_is_forwarded (const dc_msg_t*);
549 int dc_msg_is_info (const dc_msg_t*);
550 int dc_msg_is_increation (const dc_msg_t*);
551 int dc_msg_is_setupmessage (const dc_msg_t*);
552 char* dc_msg_get_setupcodebegin (const dc_msg_t*);
553 void dc_msg_set_text (dc_msg_t*, const char* text);
554 void dc_msg_set_file (dc_msg_t*, const char* file, const char* filemime);
555 void dc_msg_set_dimension (dc_msg_t*, int width, int height);
556 void dc_msg_set_duration (dc_msg_t*, int duration);
557 void dc_msg_set_location (dc_msg_t*, double latitude, double longitude);
558 void dc_msg_latefiling_mediasize (dc_msg_t*, int width, int height, int duration);
559 
560 
580 #define DC_CONTACT_ID_SELF 1
581 #define DC_CONTACT_ID_DEVICE 2
582 #define DC_CONTACT_ID_LAST_SPECIAL 9
583 
584 
585 dc_contact_t* dc_contact_new (dc_context_t*);
586 void dc_contact_empty (dc_contact_t*);
588 uint32_t dc_contact_get_id (const dc_contact_t*);
589 char* dc_contact_get_addr (const dc_contact_t*);
590 char* dc_contact_get_name (const dc_contact_t*);
595 uint32_t dc_contact_get_color (const dc_contact_t*);
598 
599 
610 #define DC_TEXT1_DRAFT 1
611 #define DC_TEXT1_USERNAME 2
612 #define DC_TEXT1_SELF 3
613 
614 
615 dc_lot_t* dc_lot_new ();
616 void dc_lot_empty (dc_lot_t*);
617 void dc_lot_unref (dc_lot_t*);
618 char* dc_lot_get_text1 (const dc_lot_t*);
619 char* dc_lot_get_text2 (const dc_lot_t*);
621 int dc_lot_get_state (const dc_lot_t*);
622 uint32_t dc_lot_get_id (const dc_lot_t*);
623 time_t dc_lot_get_timestamp (const dc_lot_t*);
624 
625 
652 #define DC_MSG_TEXT 10
653 
654 
661 #define DC_MSG_IMAGE 20
662 
663 
669 #define DC_MSG_GIF 21
670 
671 
677 #define DC_MSG_AUDIO 40
678 
679 
686 #define DC_MSG_VOICE 41
687 
688 
697 #define DC_MSG_VIDEO 50
698 
699 
705 #define DC_MSG_FILE 60
706 
730 #define DC_LP_AUTH_OAUTH2 0x2
731 
732 
737 #define DC_LP_AUTH_NORMAL 0x4
738 
739 
744 #define DC_LP_IMAP_SOCKET_STARTTLS 0x100
745 
746 
751 #define DC_LP_IMAP_SOCKET_SSL 0x200
752 
753 
758 #define DC_LP_IMAP_SOCKET_PLAIN 0x400
759 
760 
765 #define DC_LP_SMTP_SOCKET_STARTTLS 0x10000
766 
767 
772 #define DC_LP_SMTP_SOCKET_SSL 0x20000
773 
774 
779 #define DC_LP_SMTP_SOCKET_PLAIN 0x40000
780 
781 
785 #define DC_LP_AUTH_FLAGS (DC_LP_AUTH_OAUTH2|DC_LP_AUTH_NORMAL) // if none of these flags are set, the default is choosen
786 #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
787 #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
788 
789 
790 
815 #define DC_EVENT_INFO 100
816 
817 
826 #define DC_EVENT_SMTP_CONNECTED 101
827 
828 
837 #define DC_EVENT_IMAP_CONNECTED 102
838 
847 #define DC_EVENT_SMTP_MESSAGE_SENT 103
848 
849 
861 #define DC_EVENT_WARNING 300
862 
863 
883 #define DC_EVENT_ERROR 400
884 
885 
907 #define DC_EVENT_ERROR_NETWORK 401
908 
909 
923 #define DC_EVENT_ERROR_SELF_NOT_IN_GROUP 410
924 
925 
937 #define DC_EVENT_MSGS_CHANGED 2000
938 
939 
950 #define DC_EVENT_INCOMING_MSG 2005
951 
952 
961 #define DC_EVENT_MSG_DELIVERED 2010
962 
963 
972 #define DC_EVENT_MSG_FAILED 2012
973 
974 
983 #define DC_EVENT_MSG_READ 2015
984 
985 
996 #define DC_EVENT_CHAT_MODIFIED 2020
997 
998 
1006 #define DC_EVENT_CONTACTS_CHANGED 2030
1007 
1008 
1009 
1019 #define DC_EVENT_LOCATION_CHANGED 2035
1020 
1021 
1029 #define DC_EVENT_CONFIGURE_PROGRESS 2041
1030 
1031 
1039 #define DC_EVENT_IMEX_PROGRESS 2051
1040 
1041 
1054 #define DC_EVENT_IMEX_FILE_WRITTEN 2052
1055 
1056 
1072 #define DC_EVENT_SECUREJOIN_INVITER_PROGRESS 2060
1073 
1074 
1088 #define DC_EVENT_SECUREJOIN_JOINER_PROGRESS 2061
1089 
1090 
1091 // the following events are functions that should be provided by the frontends
1092 
1093 
1106 #define DC_EVENT_GET_STRING 2091
1107 
1108 
1123 #define DC_EVENT_HTTP_GET 2100
1124 
1125 
1141 #define DC_EVENT_HTTP_POST 2110
1142 
1143 
1148 #define DC_EVENT_FILE_COPIED 2055 // deprecated
1149 #define DC_EVENT_IS_OFFLINE 2081 // deprecated
1150 #define DC_ERROR_SEE_STRING 0 // deprecated
1151 #define DC_ERROR_SELF_NOT_IN_GROUP 1 // deprecated
1152 #define DC_STR_SELFNOTINGRP 21 // deprecated
1153 #define DC_EVENT_DATA1_IS_STRING(e) ((e)==DC_EVENT_HTTP_GET || (e)==DC_EVENT_IMEX_FILE_WRITTEN || (e)==DC_EVENT_FILE_COPIED)
1154 #define DC_EVENT_DATA2_IS_STRING(e) ((e)>=100 && (e)<=499)
1155 #define DC_EVENT_RETURNS_INT(e) ((e)==DC_EVENT_IS_OFFLINE)
1156 #define DC_EVENT_RETURNS_STRING(e) ((e)==DC_EVENT_GET_STRING || (e)==DC_EVENT_HTTP_GET)
1157 
1158 
1159 /*
1160  * Values for dc_get|set_config("show_emails")
1161  */
1162 #define DC_SHOW_EMAILS_OFF 0
1163 #define DC_SHOW_EMAILS_ACCEPTED_CONTACTS 1
1164 #define DC_SHOW_EMAILS_ALL 2
1165 
1166 
1167 /*
1168  * TODO: Strings need some doumentation about used placeholders.
1169  *
1170  * @defgroup DC_STR DC_STR
1171  *
1172  * These constants are used to request strings using #DC_EVENT_GET_STRING.
1173  *
1174  * @addtogroup DC_STR
1175  * @{
1176  */
1177 #define DC_STR_NOMESSAGES 1
1178 #define DC_STR_SELF 2
1179 #define DC_STR_DRAFT 3
1180 #define DC_STR_MEMBER 4
1181 #define DC_STR_CONTACT 6
1182 #define DC_STR_VOICEMESSAGE 7
1183 #define DC_STR_DEADDROP 8
1184 #define DC_STR_IMAGE 9
1185 #define DC_STR_VIDEO 10
1186 #define DC_STR_AUDIO 11
1187 #define DC_STR_FILE 12
1188 #define DC_STR_STATUSLINE 13
1189 #define DC_STR_NEWGROUPDRAFT 14
1190 #define DC_STR_MSGGRPNAME 15
1191 #define DC_STR_MSGGRPIMGCHANGED 16
1192 #define DC_STR_MSGADDMEMBER 17
1193 #define DC_STR_MSGDELMEMBER 18
1194 #define DC_STR_MSGGROUPLEFT 19
1195 #define DC_STR_GIF 23
1196 #define DC_STR_ENCRYPTEDMSG 24
1197 #define DC_STR_E2E_AVAILABLE 25
1198 #define DC_STR_ENCR_TRANSP 27
1199 #define DC_STR_ENCR_NONE 28
1200 #define DC_STR_CANTDECRYPT_MSG_BODY 29
1201 #define DC_STR_FINGERPRINTS 30
1202 #define DC_STR_READRCPT 31
1203 #define DC_STR_READRCPT_MAILBODY 32
1204 #define DC_STR_MSGGRPIMGDELETED 33
1205 #define DC_STR_E2E_PREFERRED 34
1206 #define DC_STR_CONTACT_VERIFIED 35
1207 #define DC_STR_CONTACT_NOT_VERIFIED 36
1208 #define DC_STR_CONTACT_SETUP_CHANGED 37
1209 #define DC_STR_ARCHIVEDCHATS 40
1210 #define DC_STR_STARREDMSGS 41
1211 #define DC_STR_AC_SETUP_MSG_SUBJECT 42
1212 #define DC_STR_AC_SETUP_MSG_BODY 43
1213 #define DC_STR_SELFTALK_SUBTITLE 50
1214 #define DC_STR_CANNOT_LOGIN 60
1215 #define DC_STR_SERVER_RESPONSE 61
1216 #define DC_STR_MSGACTIONBYUSER 62
1217 #define DC_STR_MSGACTIONBYME 63
1218 #define DC_STR_MSGLOCATIONENABLED 64
1219 #define DC_STR_MSGLOCATIONDISABLED 65
1220 #define DC_STR_LOCATION 66
1221 #define DC_STR_COUNT 66
1222 
1223 /*
1224  * @}
1225  */
1226 
1227 
1228 #ifdef __cplusplus
1229 }
1230 #endif
1231 #endif // __DELTACHAT_H__
dc_context_t::dc_get_blocked_contacts
dc_array_t * dc_get_blocked_contacts(dc_context_t *context)
Get blocked contacts.
Definition: dc_contact.c:1114
dc_chat_t
dc_msg_t::dc_msg_get_setupcodebegin
char * dc_msg_get_setupcodebegin(const dc_msg_t *msg)
Get the first characters of the setup code.
Definition: dc_msg.c:798
dc_context_t::dc_get_msg
dc_msg_t * dc_get_msg(dc_context_t *context, uint32_t msg_id)
Get a single message object of the type dc_msg_t.
Definition: dc_msg.c:1501
dc_contact_t::dc_contact_is_blocked
int dc_contact_is_blocked(const dc_contact_t *contact)
Check if a contact is blocked.
Definition: dc_contact.c:278
dc_context_t::dc_is_sending_locations_to_chat
int dc_is_sending_locations_to_chat(dc_context_t *context, uint32_t chat_id)
Check if location streaming is enabled.
Definition: dc_location.c:660
dc_msg_t::dc_msg_set_text
void dc_msg_set_text(dc_msg_t *msg, const char *text)
Set the text of a message object.
Definition: dc_msg.c:1104
dc_array_t::dc_array_get_uint
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
dc_contact_t::dc_contact_get_first_name
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
dc_context_t::dc_perform_sentbox_fetch
void dc_perform_sentbox_fetch(dc_context_t *context)
Fetch new messages from the Sent folder, if any.
Definition: dc_job.c:1092
dc_context_t::dc_marknoticed_chat
void dc_marknoticed_chat(dc_context_t *context, uint32_t chat_id)
Mark all messages in a chat as noticed.
Definition: dc_chat.c:634
dc_msg_t::dc_msg_get_timestamp
time_t dc_msg_get_timestamp(const dc_msg_t *msg)
Get message sending time.
Definition: dc_msg.c:238
dc_chat_t::dc_chat_is_self_talk
int dc_chat_is_self_talk(const dc_chat_t *chat)
Check if a chat is a self talk.
Definition: dc_chat.c:382
dc_context_t::dc_stop_ongoing_process
void dc_stop_ongoing_process(dc_context_t *context)
Signal an ongoing process to stop.
Definition: dc_configure.c:1227
dc_chat_t::dc_chat_is_verified
int dc_chat_is_verified(const dc_chat_t *chat)
Check if a chat is verified.
Definition: dc_chat.c:365
dc_context_t::dc_send_msg
uint32_t dc_send_msg(dc_context_t *context, uint32_t chat_id, dc_msg_t *msg)
Send a message defined by a dc_msg_t object to a chat.
Definition: dc_chat.c:2614
dc_lot_t::dc_lot_get_timestamp
time_t dc_lot_get_timestamp(const dc_lot_t *lot)
Get the associated timestamp.
Definition: dc_lot.c:169
dc_chatlist_t
dc_context_t::dc_perform_mvbox_fetch
void dc_perform_mvbox_fetch(dc_context_t *context)
Fetch new messages from the MVBOX, if any.
Definition: dc_job.c:1017
dc_context_t::dc_perform_imap_jobs
void dc_perform_imap_jobs(dc_context_t *context)
Execute pending imap-jobs.
Definition: dc_job.c:839
dc_msg_t::dc_msg_get_duration
int dc_msg_get_duration(const dc_msg_t *msg)
Get the duration of audio or video.
Definition: dc_msg.c:559
dc_chat_t::dc_chat_get_profile_image
char * dc_chat_get_profile_image(const dc_chat_t *chat)
Get the chat's profile image.
Definition: dc_chat.c:232
dc_chatlist_t::dc_chatlist_unref
void dc_chatlist_unref(dc_chatlist_t *chatlist)
Free a chatlist object.
Definition: dc_chatlist.c:40
dc_array_t::dc_array_get_marker
char * dc_array_get_marker(const dc_array_t *array, size_t index)
Return the marker-character of the item at the given index.
Definition: dc_array.c:472
dc_array_t::dc_array_get_chat_id
uint32_t dc_array_get_chat_id(const dc_array_t *array, size_t index)
Return the chat-id of the item at the given index.
Definition: dc_array.c:427
dc_context_t::dc_context_unref
void dc_context_unref(dc_context_t *context)
Free a context object.
Definition: dc_context.c:243
dc_chat_t::dc_chat_get_type
int dc_chat_get_type(const dc_chat_t *chat)
Get chat type.
Definition: dc_chat.c:130
dc_contact_t::dc_contact_is_verified
int dc_contact_is_verified(dc_contact_t *contact)
Check if a contact was verified.
Definition: dc_contact.c:335
dc_array_t::dc_array_get_timestamp
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
dc_context_t::dc_get_chat_media
dc_array_t * dc_get_chat_media(dc_context_t *context, uint32_t chat_id, int msg_type, int msg_type2, int msg_type3)
Returns all message IDs of the given types in a chat.
Definition: dc_chat.c:892
dc_msg_t::dc_msg_set_file
void dc_msg_set_file(dc_msg_t *msg, const char *file, const char *filemime)
Set the file associated with a message object.
Definition: dc_msg.c:1127
dc_context_t::dc_create_chat_by_contact_id
uint32_t dc_create_chat_by_contact_id(dc_context_t *context, uint32_t contact_id)
Create a normal chat with a single user.
Definition: dc_chat.c:774
dc_context_t::dc_interrupt_imap_idle
void dc_interrupt_imap_idle(dc_context_t *context)
Interrupt waiting for imap-jobs.
Definition: dc_job.c:958
dc_array_t::dc_array_get_contact_id
uint32_t dc_array_get_contact_id(const dc_array_t *array, size_t index)
Return the contact-id of the item at the given index.
Definition: dc_array.c:447
dc_context_t::dc_marknoticed_contact
void dc_marknoticed_contact(dc_context_t *context, uint32_t contact_id)
Mark all messages sent by the given contact as noticed.
Definition: dc_contact.c:1176
dc_context_t::dc_get_mime_headers
char * dc_get_mime_headers(dc_context_t *context, uint32_t msg_id)
Get the raw mime-headers of the given message.
Definition: dc_msg.c:1722
dc_chat_t::dc_chat_is_sending_locations
int dc_chat_is_sending_locations(const dc_chat_t *chat)
Check if locations are sent to the chat at the time the object was created using dc_get_chat().
Definition: dc_chat.c:401
dc_lot_t::dc_lot_unref
void dc_lot_unref(dc_lot_t *set)
Frees an object containing a set of parameters.
Definition: dc_lot.c:32
dc_msg_t::dc_msg_get_viewtype
int dc_msg_get_viewtype(const dc_msg_t *msg)
Get the type of the message.
Definition: dc_msg.c:174
dc_context_t::dc_initiate_key_transfer
char * dc_initiate_key_transfer(dc_context_t *context)
Initiate Autocrypt Setup Transfer.
Definition: dc_imex.c:347
dc_msg_t::dc_msg_get_filemime
char * dc_msg_get_filemime(const dc_msg_t *msg)
Get mime type of the file.
Definition: dc_msg.c:442
dc_context_t::dc_interrupt_sentbox_idle
void dc_interrupt_sentbox_idle(dc_context_t *context)
Interrupt waiting for messages or jobs in the SENTBOX-thread.
Definition: dc_job.c:1130
dc_array_t::dc_array_get_longitude
double dc_array_get_longitude(const dc_array_t *array, size_t index)
Return the longitude of the item at the given index.
Definition: dc_array.c:346
dc_context_t::dc_is_configured
int dc_is_configured(const dc_context_t *context)
Check if the context is already configured.
Definition: dc_configure.c:1146
dc_lot_t::dc_lot_get_text1_meaning
int dc_lot_get_text1_meaning(const dc_lot_t *lot)
Get the meaning of the first string.
Definition: dc_lot.c:115
dc_context_t::dc_get_contact
dc_contact_t * dc_get_contact(dc_context_t *context, uint32_t contact_id)
Get a single contact object.
Definition: dc_contact.c:1151
dc_context_t::dc_add_contact_to_chat
int dc_add_contact_to_chat(dc_context_t *context, uint32_t chat_id, uint32_t contact_id)
Add a member to a group.
Definition: dc_chat.c:2083
dc_lot_t
dc_context_t::dc_delete_contact
int dc_delete_contact(dc_context_t *context, uint32_t contact_id)
Delete a contact.
Definition: dc_contact.c:1406
dc_lot_t::dc_lot_get_state
int dc_lot_get_state(const dc_lot_t *lot)
Get the associated state.
Definition: dc_lot.c:133
dc_context_t::dc_star_msgs
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
dc_context_t::dc_delete_all_locations
void dc_delete_all_locations(dc_context_t *context)
Delete all locations on the current device.
Definition: dc_location.c:909
dc_context_t::dc_get_fresh_msgs
dc_array_t * dc_get_fresh_msgs(dc_context_t *context)
Returns the message IDs of all fresh messages of any chat.
Definition: dc_context.c:925
dc_context_t::dc_check_qr
dc_lot_t * dc_check_qr(dc_context_t *context, const char *qr)
Check a scanned QR code.
Definition: dc_qr.c:37
dc_msg_t::dc_msg_is_info
int dc_msg_is_info(const dc_msg_t *msg)
Check if the message is an informational message, created by the device or by another users.
Definition: dc_msg.c:742
dc_msg_t::dc_msg_latefiling_mediasize
void dc_msg_latefiling_mediasize(dc_msg_t *msg, int width, int height, int duration)
Late filing information to a message.
Definition: dc_msg.c:1227
dc_context_t::dc_check_password
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
dc_chat_t::dc_chat_get_name
char * dc_chat_get_name(const dc_chat_t *chat)
Get name of a chat.
Definition: dc_chat.c:152
dc_chat_t::dc_chat_unref
void dc_chat_unref(dc_chat_t *chat)
Free a chat object.
Definition: dc_chat.c:45
dc_msg_t::dc_msg_is_starred
int dc_msg_is_starred(const dc_msg_t *msg)
Check if a message is starred.
Definition: dc_msg.c:692
dc_array_t::dc_array_get_ptr
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_msg_t::dc_msg_set_dimension
void dc_msg_set_dimension(dc_msg_t *msg, int width, int height)
Set the dimensions associated with message object.
Definition: dc_msg.c:1148
dc_msg_t::dc_msg_get_from_id
uint32_t dc_msg_get_from_id(const dc_msg_t *msg)
Get the ID of contact who wrote the message.
Definition: dc_msg.c:138
dc_msg_t::dc_msg_get_received_timestamp
time_t dc_msg_get_received_timestamp(const dc_msg_t *msg)
Get message receive time.
Definition: dc_msg.c:259
dc_msg_t::dc_msg_get_width
int dc_msg_get_width(const dc_msg_t *msg)
Get width of image or video.
Definition: dc_msg.c:516
dc_msg_t::dc_msg_get_chat_id
uint32_t dc_msg_get_chat_id(const dc_msg_t *msg)
Get the ID of chat the message belongs to.
Definition: dc_msg.c:157
dc_array_t::dc_array_get_msg_id
uint32_t dc_array_get_msg_id(const dc_array_t *array, size_t index)
Return the message-id of the item at the given index.
Definition: dc_array.c:407
dc_context_t::dc_perform_mvbox_idle
void dc_perform_mvbox_idle(dc_context_t *context)
Wait for messages or jobs in the MVBOX-thread.
Definition: dc_job.c:1041
dc_context_t::dc_set_draft
void dc_set_draft(dc_context_t *context, uint32_t chat_id, dc_msg_t *msg)
Save a draft for a chat in the database.
Definition: dc_chat.c:1273
dc_context_t::dc_get_chat_msgs
dc_array_t * dc_get_chat_msgs(dc_context_t *context, uint32_t chat_id, uint32_t flags, uint32_t marker1before)
Get all message IDs belonging to a chat.
Definition: dc_chat.c:1056
dc_contact_t::dc_contact_get_addr
char * dc_contact_get_addr(const dc_contact_t *contact)
Get email address.
Definition: dc_contact.c:108
dc_array_t
dc_context_t::dc_close
void dc_close(dc_context_t *context)
Close context database opened by dc_open().
Definition: dc_context.c:362
dc_msg_t::dc_msg_get_height
int dc_msg_get_height(const dc_msg_t *msg)
Get height of image or video.
Definition: dc_msg.c:539
dc_contact_t::dc_contact_get_color
uint32_t dc_contact_get_color(const dc_contact_t *contact)
Get a color for the contact.
Definition: dc_contact.c:259
dc_lot_t::dc_lot_get_text2
char * dc_lot_get_text2(const dc_lot_t *lot)
Get second string.
Definition: dc_lot.c:97
dc_context_t::dc_prepare_msg
uint32_t dc_prepare_msg(dc_context_t *context, uint32_t chat_id, dc_msg_t *msg)
Prepare a message for sending.
Definition: dc_chat.c:2572
dc_msg_t::dc_msg_set_location
void dc_msg_set_location(dc_msg_t *msg, double latitude, double longitude)
Set any location that should be bound to the message object.
Definition: dc_msg.c:1194
dc_context_t::dc_perform_smtp_idle
void dc_perform_smtp_idle(dc_context_t *context)
Wait for smtp-jobs.
Definition: dc_job.c:1212
dc_context_t::dc_perform_smtp_jobs
void dc_perform_smtp_jobs(dc_context_t *context)
Execute pending smtp-jobs.
Definition: dc_job.c:1176
dc_msg_t::dc_msg_unref
void dc_msg_unref(dc_msg_t *msg)
Free a message object.
Definition: dc_msg.c:63
dc_msg_t::dc_msg_get_filebytes
uint64_t dc_msg_get_filebytes(const dc_msg_t *msg)
Get the size of the file.
Definition: dc_msg.c:480
dc_context_t::dc_interrupt_mvbox_idle
void dc_interrupt_mvbox_idle(dc_context_t *context)
Interrupt waiting for MVBOX-fetch.
Definition: dc_job.c:1067
dc_context_t::dc_get_msg_cnt
int dc_get_msg_cnt(dc_context_t *context, uint32_t chat_id)
Get the total number of messages in a chat.
Definition: dc_chat.c:1434
dc_array_t::dc_array_get_id
uint32_t dc_array_get_id(const dc_array_t *array, size_t index)
Get the item at the given index as an ID.
Definition: dc_array.c:285
dc_context_t::dc_get_contact_encrinfo
char * dc_get_contact_encrinfo(dc_context_t *context, uint32_t contact_id)
Get encryption info for a contact.
Definition: dc_contact.c:1315
dc_chat_t::dc_chat_is_unpromoted
int dc_chat_is_unpromoted(const dc_chat_t *chat)
Check if a group chat is still unpromoted.
Definition: dc_chat.c:347
dc_context_t::dc_perform_imap_idle
void dc_perform_imap_idle(dc_context_t *context)
Wait for messages or jobs.
Definition: dc_job.c:907
dc_context_t::dc_imex
void dc_imex(dc_context_t *context, int what, const char *param1, const char *param2)
Import/export things.
Definition: dc_imex.c:1040
dc_context_t::dc_continue_key_transfer
int dc_continue_key_transfer(dc_context_t *context, uint32_t msg_id, const char *setup_code)
Continue the Autocrypt Key Transfer on another device.
Definition: dc_imex.c:516
dc_array_t::dc_array_get_accuracy
double dc_array_get_accuracy(const dc_array_t *array, size_t index)
Return the accuracy of the item at the given index.
Definition: dc_array.c:367
dc_context_t::dc_set_chat_profile_image
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
dc_context_t::dc_remove_contact_from_chat
int dc_remove_contact_from_chat(dc_context_t *context, uint32_t chat_id, uint32_t contact_id)
Remove a member from a group.
Definition: dc_chat.c:2103
dc_context_t::dc_get_next_media
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
dc_msg_t::dc_msg_get_file
char * dc_msg_get_file(const dc_msg_t *msg)
Find out full path, file name and extension of the file associated with a message.
Definition: dc_msg.c:382
dc_chatlist_t::dc_chatlist_get_msg_id
uint32_t dc_chatlist_get_msg_id(const dc_chatlist_t *chatlist, size_t index)
Get a single message ID of a chatlist.
Definition: dc_chatlist.c:120
dc_context_t::dc_get_securejoin_qr
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
dc_contact_t::dc_contact_unref
void dc_contact_unref(dc_contact_t *contact)
Free a contact object.
Definition: dc_contact.c:42
dc_msg_t::dc_msg_has_deviating_timestamp
int dc_msg_has_deviating_timestamp(const dc_msg_t *msg)
Check if a message has a deviating timestamp.
Definition: dc_msg.c:306
dc_context_t::dc_set_chat_name
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
dc_msg_t::dc_msg_get_summarytext
char * dc_msg_get_summarytext(const dc_msg_t *msg, int approx_characters)
Get a message summary as a single line of text.
Definition: dc_msg.c:651
dc_context_t::dc_get_info
char * dc_get_info(dc_context_t *context)
Get information about the context.
Definition: dc_context.c:737
dc_array_t::dc_array_is_independent
int dc_array_is_independent(const dc_array_t *array, size_t index)
Return the independent-state of the location at the given index.
Definition: dc_array.c:493
dc_chat_t::dc_chat_get_id
uint32_t dc_chat_get_id(const dc_chat_t *chat)
Get chat ID.
Definition: dc_chat.c:101
dc_context_t::dc_interrupt_smtp_idle
void dc_interrupt_smtp_idle(dc_context_t *context)
Interrupt waiting for smtp-jobs.
Definition: dc_job.c:1263
dc_chatlist_t::dc_chatlist_get_chat_id
uint32_t dc_chatlist_get_chat_id(const dc_chatlist_t *chatlist, size_t index)
Get a single chat ID of a chatlist.
Definition: dc_chatlist.c:99
dc_contact_t::dc_contact_get_name
char * dc_contact_get_name(const dc_contact_t *contact)
Get the contact name.
Definition: dc_contact.c:129
dc_context_t::dc_create_chat_by_msg_id
uint32_t dc_create_chat_by_msg_id(dc_context_t *context, uint32_t msg_id)
Create a normal chat or a group chat by a messages ID that comes typically from the deaddrop,...
Definition: dc_chat.c:839
dc_context_t::dc_get_chat_contacts
dc_array_t * dc_get_chat_contacts(dc_context_t *context, uint32_t chat_id)
Get contact IDs belonging to a chat.
Definition: dc_chat.c:1006
dc_context_t::dc_may_be_valid_addr
int dc_may_be_valid_addr(const char *addr)
Rough check if a string may be a valid e-mail address.
Definition: dc_contact.c:946
dc_context_t
dc_contact_t
dc_context_t::dc_get_chat
dc_chat_t * dc_get_chat(dc_context_t *context, uint32_t chat_id)
Get chat object by a chat ID.
Definition: dc_chat.c:594
dc_context_t::dc_get_oauth2_url
char * dc_get_oauth2_url(dc_context_t *context, const char *addr, const char *redirect_uri)
Get url that can be used to initiate an OAuth2 authorisation.
Definition: dc_oauth2.c:161
dc_context_t::dc_get_contacts
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
dc_context_t::dc_get_chatlist
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_context_t::dc_is_contact_in_chat
int dc_is_contact_in_chat(dc_context_t *context, uint32_t chat_id, uint32_t contact_id)
Check if a given contact ID is a member of a group chat.
Definition: dc_chat.c:1960
dc_context_t::dc_send_locations_to_chat
void dc_send_locations_to_chat(dc_context_t *context, uint32_t chat_id, int seconds)
Enable or disable location streaming for a chat.
Definition: dc_location.c:593
dc_chatlist_t::dc_chatlist_get_context
dc_context_t * dc_chatlist_get_context(dc_chatlist_t *chatlist)
Helper function to get the associated context object.
Definition: dc_chatlist.c:228
dc_chat_t::dc_chat_get_archived
int dc_chat_get_archived(const dc_chat_t *chat)
Get archived state.
Definition: dc_chat.c:318
dc_context_t::dc_configure
void dc_configure(dc_context_t *context)
Configure a context.
Definition: dc_configure.c:1123
dc_msg_t::dc_msg_is_increation
int dc_msg_is_increation(const dc_msg_t *msg)
Check if a message is still in creation.
Definition: dc_msg.c:1070
dc_context_t::dc_join_securejoin
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
dc_chat_t::dc_chat_get_subtitle
char * dc_chat_get_subtitle(const dc_chat_t *chat)
Get a subtitle for a chat.
Definition: dc_chat.c:172
dc_context_t::dc_add_address_book
int dc_add_address_book(dc_context_t *context, const char *adr_book)
Add a number of contacts.
Definition: dc_contact.c:891
dc_lot_t::dc_lot_get_id
uint32_t dc_lot_get_id(const dc_lot_t *lot)
Get the associated ID.
Definition: dc_lot.c:149
dc_context_t::dc_block_contact
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
dc_context_t::dc_send_text_msg
uint32_t dc_send_text_msg(dc_context_t *context, uint32_t chat_id, const char *text_to_send)
Send a simple text message a given chat.
Definition: dc_chat.c:2687
dc_context_t::dc_get_blobdir
char * dc_get_blobdir(const dc_context_t *context)
Get the blob directory.
Definition: dc_context.c:410
dc_msg_t::dc_msg_get_sort_timestamp
time_t dc_msg_get_sort_timestamp(const dc_msg_t *msg)
Get message time used for sorting.
Definition: dc_msg.c:282
dc_contact_t::dc_contact_get_id
uint32_t dc_contact_get_id(const dc_contact_t *contact)
Get the ID of the contact.
Definition: dc_contact.c:92
dc_context_t::dc_imex_has_backup
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
dc_msg_t::dc_msg_is_setupmessage
int dc_msg_is_setupmessage(const dc_msg_t *msg)
Check if the message is an Autocrypt Setup Message.
Definition: dc_msg.c:774
dc_context_t::dc_create_contact
uint32_t dc_create_contact(dc_context_t *context, const char *name, const char *addr)
Add a single contact as a result of an explicit user action.
Definition: dc_contact.c:843
dc_chatlist_t::dc_chatlist_get_summary
dc_lot_t * dc_chatlist_get_summary(const dc_chatlist_t *chatlist, size_t index, dc_chat_t *chat)
Get a summary for a chatlist index.
Definition: dc_chatlist.c:156
dc_array_t::dc_array_get_cnt
size_t dc_array_get_cnt(const dc_array_t *array)
Find out the number of items in an array.
Definition: dc_array.c:248
dc_array_t::dc_array_get_raw
const uintptr_t * dc_array_get_raw(const dc_array_t *array)
Get raw pointer to the data.
Definition: dc_array.c:543
dc_context_t::dc_get_userdata
void * dc_get_userdata(dc_context_t *context)
Get user data associated with a context object.
Definition: dc_context.c:285
dc_context_t::dc_perform_imap_fetch
void dc_perform_imap_fetch(dc_context_t *context)
Fetch new messages, if any.
Definition: dc_job.c:867
dc_msg_t
dc_msg_t::dc_msg_get_state
int dc_msg_get_state(const dc_msg_t *msg)
Get the state of a message.
Definition: dc_msg.c:213
dc_contact_t::dc_contact_get_display_name
char * dc_contact_get_display_name(const dc_contact_t *contact)
Get display name.
Definition: dc_contact.c:150
dc_context_t::dc_get_msg_info
char * dc_get_msg_info(dc_context_t *context, uint32_t msg_id)
Get an informational text for a single message.
Definition: dc_msg.c:1539
dc_msg_t::dc_msg_get_filename
char * dc_msg_get_filename(const dc_msg_t *msg)
Get base file name without path.
Definition: dc_msg.c:411
dc_context_t::dc_open
int dc_open(dc_context_t *context, const char *dbfile, const char *blobdir)
Open context database.
Definition: dc_context.c:309
dc_context_t::dc_is_open
int dc_is_open(const dc_context_t *context)
Check if the context database is open.
Definition: dc_context.c:392
dc_context_t::dc_create_group_chat
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
dc_context_t::dc_get_chat_id_by_contact_id
uint32_t dc_get_chat_id_by_contact_id(dc_context_t *context, uint32_t contact_id)
Check, if there is a normal chat with a given contact.
Definition: dc_chat.c:718
dc_context_t::dc_archive_chat
void dc_archive_chat(dc_context_t *context, uint32_t chat_id, int archive)
Archive or unarchive a chat.
Definition: dc_chat.c:1524
dc_msg_t::dc_msg_get_summary
dc_lot_t * dc_msg_get_summary(const dc_msg_t *msg, const dc_chat_t *chat)
Get a summary for a message.
Definition: dc_msg.c:611
dc_msg_t::dc_msg_is_forwarded
int dc_msg_is_forwarded(const dc_msg_t *msg)
Check if the message is a forwarded message.
Definition: dc_msg.c:717
dc_context_t::dc_markseen_msgs
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_msg_t::dc_msg_has_location
int dc_msg_has_location(const dc_msg_t *msg)
Check if a message has a location bound to it.
Definition: dc_msg.c:326
dc_context_t::dc_forward_msgs
void dc_forward_msgs(dc_context_t *context, const uint32_t *msg_ids, int msg_cnt, uint32_t chat_id)
Forward messages to another chat.
Definition: dc_chat.c:2753
dc_context_t::dc_delete_chat
void dc_delete_chat(dc_context_t *context, uint32_t chat_id)
Delete a chat.
Definition: dc_chat.c:1599
dc_context_t::dc_callback_t
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
dc_contact_t::dc_contact_get_name_n_addr
char * dc_contact_get_name_n_addr(const dc_contact_t *contact)
Get a summary of name and address.
Definition: dc_contact.c:177
dc_msg_t::dc_msg_get_id
uint32_t dc_msg_get_id(const dc_msg_t *msg)
Get the ID of the message.
Definition: dc_msg.c:115
dc_context_t::dc_get_locations
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
dc_context_t::dc_openssl_init_not_required
void dc_openssl_init_not_required(void)
Skip OpenSSL initialisation.
Definition: dc_openssl.c:30
dc_contact_t::dc_contact_get_profile_image
char * dc_contact_get_profile_image(const dc_contact_t *contact)
Get the contact's profile image.
Definition: dc_contact.c:225
dc_context_t::dc_set_location
int dc_set_location(dc_context_t *context, double latitude, double longitude, double accuracy)
Set current location.
Definition: dc_location.c:716
dc_msg_t::dc_msg_is_sent
int dc_msg_is_sent(const dc_msg_t *msg)
Check if a message was sent successfully.
Definition: dc_msg.c:671
dc_msg_t::dc_msg_get_showpadlock
int dc_msg_get_showpadlock(const dc_msg_t *msg)
Check if a padlock should be shown beside the message.
Definition: dc_msg.c:575
dc_context_t::dc_get_blocked_cnt
int dc_get_blocked_cnt(dc_context_t *context)
Get the number of blocked contacts.
Definition: dc_contact.c:1199
dc_msg_t::dc_msg_set_duration
void dc_msg_set_duration(dc_msg_t *msg, int duration)
Set the duration associated with message object.
Definition: dc_msg.c:1168
dc_context_t::dc_get_draft
dc_msg_t * dc_get_draft(dc_context_t *context, uint32_t chat_id)
Get draft for a chat, if any.
Definition: dc_chat.c:1297
dc_context_t::dc_maybe_network
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:1296
dc_context_t::dc_get_fresh_msg_cnt
int dc_get_fresh_msg_cnt(dc_context_t *context, uint32_t chat_id)
Get the number of fresh messages in a chat.
Definition: dc_chat.c:1477
dc_context_t::dc_delete_msgs
void dc_delete_msgs(dc_context_t *context, const uint32_t *msg_ids, int msg_cnt)
Delete messages.
Definition: dc_msg.c:1829
dc_chatlist_t::dc_chatlist_get_cnt
size_t dc_chatlist_get_cnt(const dc_chatlist_t *chatlist)
Find out the number of chats in a chatlist.
Definition: dc_chatlist.c:78
dc_lot_t::dc_lot_get_text1
char * dc_lot_get_text1(const dc_lot_t *lot)
Get first string.
Definition: dc_lot.c:79
dc_context_t::dc_lookup_contact_id_by_addr
uint32_t dc_lookup_contact_id_by_addr(dc_context_t *context, const char *addr)
Check if an e-mail address belongs to a known and unblocked contact.
Definition: dc_contact.c:978
dc_context_t::dc_marknoticed_all_chats
void dc_marknoticed_all_chats(dc_context_t *context)
Same as dc_marknoticed_chat() but for all chats.
Definition: dc_chat.c:678
dc_context_t::dc_search_msgs
dc_array_t * dc_search_msgs(dc_context_t *context, uint32_t chat_id, const char *query)
Search messages containing the given query string.
Definition: dc_context.c:977
dc_context_t::dc_get_config
char * dc_get_config(dc_context_t *context, const char *key)
Get a configuration option.
Definition: dc_context.c:608
dc_context_t::dc_context_new
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
dc_msg_t::dc_msg_new
dc_msg_t * dc_msg_new(dc_context_t *context, int viewtype)
Create new message object.
Definition: dc_msg.c:23
dc_chat_t::dc_chat_get_color
uint32_t dc_chat_get_color(const dc_chat_t *chat)
Get a color for the chat.
Definition: dc_chat.c:275
dc_context_t::dc_set_config
int dc_set_config(dc_context_t *context, const char *key, const char *value)
Configure the context.
Definition: dc_context.c:536
dc_array_t::dc_array_get_latitude
double dc_array_get_latitude(const dc_array_t *array, size_t index)
Return the latitude of the item at the given index.
Definition: dc_array.c:326
dc_array_t::dc_array_unref
void dc_array_unref(dc_array_t *array)
Free an array object.
Definition: dc_array.c:54
dc_context_t::dc_perform_sentbox_idle
void dc_perform_sentbox_idle(dc_context_t *context)
Wait for messages or jobs in the SENTBOX-thread.
Definition: dc_job.c:1112
dc_msg_t::dc_msg_get_text
char * dc_msg_get_text(const dc_msg_t *msg)
Get the text of the message.
Definition: dc_msg.c:355