1 #ifndef __DELTACHAT_H__ 2 #define __DELTACHAT_H__ 14 #define DC_VERSION_STR "0.39.0" 222 int dc_open (dc_context_t*,
const char* dbfile,
const char* blobdir);
227 int dc_set_config (dc_context_t*,
const char* key,
const char* value);
230 char* dc_get_version_str (
void);
232 void dc_no_compound_msgs (
void);
260 #define DC_GCL_ARCHIVED_ONLY 0x01 261 #define DC_GCL_NO_SPECIALS 0x02 262 #define DC_GCL_ADD_ALLDONE_HINT 0x04 272 uint32_t
dc_send_text_msg (dc_context_t*, uint32_t chat_id,
const char* text_to_send);
276 #define DC_GCM_ADDDAYMARKER 0x01 284 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);
307 void dc_delete_msgs (dc_context_t*,
const uint32_t* msg_ids,
int msg_cnt);
308 void dc_forward_msgs (dc_context_t*,
const uint32_t* msg_ids,
int msg_cnt, uint32_t chat_id);
310 void dc_markseen_msgs (dc_context_t*,
const uint32_t* msg_ids,
int msg_cnt);
311 void dc_star_msgs (dc_context_t*,
const uint32_t* msg_ids,
int msg_cnt,
int star);
321 #define DC_GCL_VERIFIED_ONLY 0x01 322 #define DC_GCL_ADD_SELF 0x02 334 #define DC_IMEX_EXPORT_SELF_KEYS 1 // param1 is a directory where the keys are written to 335 #define DC_IMEX_IMPORT_SELF_KEYS 2 // param1 is a directory where the keys are searched in and read from 336 #define DC_IMEX_EXPORT_BACKUP 11 // param1 is a directory where the backup is written to 337 #define DC_IMEX_IMPORT_BACKUP 12 // param1 is the file with the backup to import 338 void dc_imex (dc_context_t*,
int what,
const char* param1,
const char* param2);
347 #define DC_QR_ASK_VERIFYCONTACT 200 // id=contact 348 #define DC_QR_ASK_VERIFYGROUP 202 // text1=groupname 349 #define DC_QR_FPR_OK 210 // id=contact 350 #define DC_QR_FPR_MISMATCH 220 // id=contact 351 #define DC_QR_FPR_WITHOUT_ADDR 230 // test1=formatted fingerprint 352 #define DC_QR_ADDR 320 // id=contact 353 #define DC_QR_TEXT 330 // text1=text 354 #define DC_QR_URL 332 // text1=URL 355 #define DC_QR_ERROR 400 // text1=error string 369 dc_array_t* dc_array_new (dc_context_t*,
size_t initsize);
373 void dc_array_add_uint (
dc_array_t*, uintptr_t);
382 int dc_array_search_id (
const dc_array_t*, uint32_t needle,
size_t* indx);
442 #define DC_CHAT_ID_DEADDROP 1 // virtual chat showing all messages belonging to chats flagged with chats.blocked=2 443 #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) 444 #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) 445 #define DC_CHAT_ID_STARRED 5 // virtual chat showing all messages flagged with msgs.starred=2 446 #define DC_CHAT_ID_ARCHIVED_LINK 6 // only an indicator in a chatlist 447 #define DC_CHAT_ID_ALLDONE_HINT 7 // only an indicator in a chatlist 448 #define DC_CHAT_ID_LAST_SPECIAL 9 // larger chat IDs are "real" chats, their messages are "real" messages. 451 #define DC_CHAT_TYPE_UNDEFINED 0 452 #define DC_CHAT_TYPE_SINGLE 100 453 #define DC_CHAT_TYPE_GROUP 120 454 #define DC_CHAT_TYPE_VERIFIED_GROUP 130 480 #define DC_MSG_ID_MARKER1 1 481 #define DC_MSG_ID_DAYMARKER 9 482 #define DC_MSG_ID_LAST_SPECIAL 9 485 #define DC_STATE_UNDEFINED 0 486 #define DC_STATE_IN_FRESH 10 487 #define DC_STATE_IN_NOTICED 13 488 #define DC_STATE_IN_SEEN 16 489 #define DC_STATE_OUT_DRAFT 19 490 #define DC_STATE_OUT_PENDING 20 491 #define DC_STATE_OUT_FAILED 24 492 #define DC_STATE_OUT_DELIVERED 26 // to check if a mail was sent, use dc_msg_is_sent() 493 #define DC_STATE_OUT_MDN_RCVD 28 496 #define DC_MAX_GET_TEXT_LEN 30000 // approx. max. lenght returned by dc_msg_get_text() 497 #define DC_MAX_GET_INFO_LEN 100000 // approx. max. lenght returned by dc_get_msg_info() 556 #define DC_CONTACT_ID_SELF 1 557 #define DC_CONTACT_ID_DEVICE 2 558 #define DC_CONTACT_ID_LAST_SPECIAL 9 586 #define DC_TEXT1_DRAFT 1 587 #define DC_TEXT1_USERNAME 2 588 #define DC_TEXT1_SELF 3 628 #define DC_MSG_TEXT 10 637 #define DC_MSG_IMAGE 20 645 #define DC_MSG_GIF 21 653 #define DC_MSG_AUDIO 40 662 #define DC_MSG_VOICE 41 673 #define DC_MSG_VIDEO 50 681 #define DC_MSG_FILE 60 704 #define DC_LP_AUTH_NORMAL 0x4 711 #define DC_LP_IMAP_SOCKET_STARTTLS 0x100 718 #define DC_LP_IMAP_SOCKET_SSL 0x200 725 #define DC_LP_IMAP_SOCKET_PLAIN 0x400 732 #define DC_LP_SMTP_SOCKET_STARTTLS 0x10000 739 #define DC_LP_SMTP_SOCKET_SSL 0x20000 746 #define DC_LP_SMTP_SOCKET_PLAIN 0x40000 752 #define DC_LP_AUTH_XOAUTH2 0x2 753 #define DC_LP_AUTH_FLAGS (DC_LP_AUTH_XOAUTH2|DC_LP_AUTH_NORMAL) // if none of these flags are set, the default is choosen 754 #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 755 #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 783 #define DC_EVENT_INFO 100 794 #define DC_EVENT_SMTP_CONNECTED 101 805 #define DC_EVENT_IMAP_CONNECTED 102 815 #define DC_EVENT_SMTP_MESSAGE_SENT 103 829 #define DC_EVENT_WARNING 300 851 #define DC_EVENT_ERROR 400 875 #define DC_EVENT_ERROR_NETWORK 401 891 #define DC_EVENT_ERROR_SELF_NOT_IN_GROUP 410 905 #define DC_EVENT_MSGS_CHANGED 2000 918 #define DC_EVENT_INCOMING_MSG 2005 929 #define DC_EVENT_MSG_DELIVERED 2010 940 #define DC_EVENT_MSG_FAILED 2012 951 #define DC_EVENT_MSG_READ 2015 964 #define DC_EVENT_CHAT_MODIFIED 2020 974 #define DC_EVENT_CONTACTS_CHANGED 2030 984 #define DC_EVENT_CONFIGURE_PROGRESS 2041 994 #define DC_EVENT_IMEX_PROGRESS 2051 1009 #define DC_EVENT_IMEX_FILE_WRITTEN 2052 1027 #define DC_EVENT_SECUREJOIN_INVITER_PROGRESS 2060 1043 #define DC_EVENT_SECUREJOIN_JOINER_PROGRESS 2061 1061 #define DC_EVENT_GET_STRING 2091 1077 #define DC_EVENT_HTTP_GET 2100 1083 #define DC_EVENT_FILE_COPIED 2055 // deprecated 1084 #define DC_EVENT_IS_OFFLINE 2081 // deprecated 1085 #define DC_ERROR_SEE_STRING 0 // deprecated 1086 #define DC_ERROR_SELF_NOT_IN_GROUP 1 // deprecated 1087 #define DC_STR_SELFNOTINGRP 21 // deprecated 1088 #define DC_EVENT_DATA1_IS_STRING(e) ((e)==DC_EVENT_HTTP_GET || (e)==DC_EVENT_IMEX_FILE_WRITTEN || (e)==DC_EVENT_FILE_COPIED) 1089 #define DC_EVENT_DATA2_IS_STRING(e) ((e)>=100 && (e)<=499) 1090 #define DC_EVENT_RETURNS_INT(e) ((e)==DC_EVENT_IS_OFFLINE) 1091 #define DC_EVENT_RETURNS_STRING(e) ((e)==DC_EVENT_GET_STRING || (e)==DC_EVENT_HTTP_GET) 1104 #define DC_STR_NOMESSAGES 1 1105 #define DC_STR_SELF 2 1106 #define DC_STR_DRAFT 3 1107 #define DC_STR_MEMBER 4 1108 #define DC_STR_CONTACT 6 1109 #define DC_STR_VOICEMESSAGE 7 1110 #define DC_STR_DEADDROP 8 1111 #define DC_STR_IMAGE 9 1112 #define DC_STR_VIDEO 10 1113 #define DC_STR_AUDIO 11 1114 #define DC_STR_FILE 12 1115 #define DC_STR_STATUSLINE 13 1116 #define DC_STR_NEWGROUPDRAFT 14 1117 #define DC_STR_MSGGRPNAME 15 1118 #define DC_STR_MSGGRPIMGCHANGED 16 1119 #define DC_STR_MSGADDMEMBER 17 1120 #define DC_STR_MSGDELMEMBER 18 1121 #define DC_STR_MSGGROUPLEFT 19 1122 #define DC_STR_GIF 23 1123 #define DC_STR_ENCRYPTEDMSG 24 1124 #define DC_STR_E2E_AVAILABLE 25 1125 #define DC_STR_ENCR_TRANSP 27 1126 #define DC_STR_ENCR_NONE 28 1127 #define DC_STR_CANTDECRYPT_MSG_BODY 29 1128 #define DC_STR_FINGERPRINTS 30 1129 #define DC_STR_READRCPT 31 1130 #define DC_STR_READRCPT_MAILBODY 32 1131 #define DC_STR_MSGGRPIMGDELETED 33 1132 #define DC_STR_E2E_PREFERRED 34 1133 #define DC_STR_CONTACT_VERIFIED 35 1134 #define DC_STR_CONTACT_NOT_VERIFIED 36 1135 #define DC_STR_CONTACT_SETUP_CHANGED 37 1136 #define DC_STR_ARCHIVEDCHATS 40 1137 #define DC_STR_STARREDMSGS 41 1138 #define DC_STR_AC_SETUP_MSG_SUBJECT 42 1139 #define DC_STR_AC_SETUP_MSG_BODY 43 1140 #define DC_STR_SELFTALK_SUBTITLE 50 1141 #define DC_STR_CANNOT_LOGIN 60 1142 #define DC_STR_SERVER_RESPONSE 61 1143 #define DC_STR_MSGACTIONBYUSER 62 1144 #define DC_STR_MSGACTIONBYME 63 1145 #define DC_STR_COUNT 64 1155 #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:883
char * dc_get_contact_encrinfo(dc_context_t *context, uint32_t contact_id)
Get encryption info for a contact.
Definition: dc_contact.c:1307
void dc_perform_mvbox_idle(dc_context_t *context)
Wait for messages or jobs in the MVBOX-thread.
Definition: dc_job.c:883
int dc_chat_is_verified(const dc_chat_t *chat)
Check if a chat is verified.
Definition: dc_chat.c:364
int dc_msg_is_setupmessage(const dc_msg_t *msg)
Check if the message is an Autocrypt Setup Message.
Definition: dc_msg.c:752
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:934
dc_array_t * dc_get_blocked_contacts(dc_context_t *context)
Get blocked contacts.
Definition: dc_contact.c:1106
time_t dc_lot_get_timestamp(const dc_lot_t *lot)
Get the associated timestamp.
Definition: dc_lot.c:169
void dc_context_unref(dc_context_t *context)
Free a context object.
Definition: dc_context.c:234
int dc_open(dc_context_t *context, const char *dbfile, const char *blobdir)
Open context database.
Definition: dc_context.c:299
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:720
void dc_marknoticed_chat(dc_context_t *context, uint32_t chat_id)
Mark all messages in a chat as noticed.
Definition: dc_chat.c:578
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:517
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:718
void dc_msg_set_dimension(dc_msg_t *msg, int width, int height)
Set the dimensions associated with message object.
Definition: dc_msg.c:1130
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:2019
void dc_array_unref(dc_array_t *array)
Free an array object.
Definition: dc_array.c:46
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_is_configured(const dc_context_t *context)
Check if the context is already configured.
Definition: dc_configure.c:1111
int dc_msg_is_forwarded(const dc_msg_t *msg)
Check if the message is a forwarded message.
Definition: dc_msg.c:695
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:1682
void dc_interrupt_smtp_idle(dc_context_t *context)
Interrupt waiting for smtp-jobs.
Definition: dc_job.c:1105
An object representing a single chatlist in memory.
char * dc_chat_get_profile_image(const dc_chat_t *chat)
Get the chat's profile image.
Definition: dc_chat.c:231
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:1000
An object representing a single account.
void dc_imex(dc_context_t *context, int what, const char *param1, const char *param2)
Import/export things.
Definition: dc_imex.c:1121
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:1670
char * dc_imex_has_backup(dc_context_t *context, const char *dir_name)
Check if there is a backup file.
Definition: dc_imex.c:1272
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:360
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:1818
int dc_msg_has_deviating_timestamp(const dc_msg_t *msg)
Check if a message has a deviating timestamp.
Definition: dc_msg.c:303
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:1420
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:970
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:2039
char * dc_get_blobdir(const dc_context_t *context)
Get the blob directory.
Definition: dc_context.c:400
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:333
void dc_perform_mvbox_fetch(dc_context_t *context)
Fetch new messages from the MVBOX, if any.
Definition: dc_job.c:859
uint64_t dc_msg_get_filebytes(const dc_msg_t *msg)
Get the size of the file.
Definition: dc_msg.c:458
int dc_msg_is_sent(const dc_msg_t *msg)
Check if a message was sent successfully.
Definition: dc_msg.c:649
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:1211
int dc_add_address_book(dc_context_t *context, const char *adr_book)
Add a number of contacts.
Definition: dc_contact.c:883
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
int dc_chat_get_type(const dc_chat_t *chat)
Get chat type.
Definition: dc_chat.c:129
void dc_block_contact(dc_context_t *context, uint32_t contact_id, int new_blocking)
Block or unblock a contact.
Definition: dc_contact.c:1225
void dc_perform_smtp_jobs(dc_context_t *context)
Execute pending smtp-jobs.
Definition: dc_job.c:1018
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
An object representing a single chat in memory.
char * dc_get_info(dc_context_t *context)
Get information about the context.
Definition: dc_context.c:706
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:288
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:175
int dc_msg_is_increation(const dc_msg_t *msg)
Check if a message is still in creation.
Definition: dc_msg.c:1037
void dc_perform_sentbox_idle(dc_context_t *context)
Wait for messages or jobs in the SENTBOX-thread.
Definition: dc_job.c:954
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:1235
int dc_is_open(const dc_context_t *context)
Check if the context database is open.
Definition: dc_context.c:382
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:882
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:1458
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:938
void dc_interrupt_mvbox_idle(dc_context_t *context)
Interrupt waiting for MVBOX-fetch.
Definition: dc_job.c:909
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:2567
uint32_t dc_chat_get_id(const dc_chat_t *chat)
Get chat ID.
Definition: dc_chat.c:100
int dc_msg_get_duration(const dc_msg_t *msg)
Get the duration of audio or video.
Definition: dc_msg.c:537
char * dc_msg_get_filename(const dc_msg_t *msg)
Get base file name without path.
Definition: dc_msg.c:389
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:252
void dc_interrupt_sentbox_idle(dc_context_t *context)
Interrupt waiting for messages or jobs in the SENTBOX-thread.
Definition: dc_job.c:972
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:270
void * dc_get_userdata(dc_context_t *context)
Get user data associated with a context object.
Definition: dc_context.c:275
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:749
char * dc_chat_get_name(const dc_chat_t *chat)
Get name of a chat.
Definition: dc_chat.c:151
time_t dc_msg_get_sort_timestamp(const dc_msg_t *msg)
Get message time used for sorting.
Definition: dc_msg.c:279
void dc_delete_chat(dc_context_t *context, uint32_t chat_id)
Delete a chat.
Definition: dc_chat.c:1537
void dc_perform_imap_fetch(dc_context_t *context)
Fetch new messages, if any.
Definition: dc_job.c:709
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:1785
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:538
char * dc_msg_get_filemime(const dc_msg_t *msg)
Get mime type of the file.
Definition: dc_msg.c:420
int dc_msg_get_state(const dc_msg_t *msg)
Get the state of a message.
Definition: dc_msg.c:210
char * dc_chat_get_subtitle(const dc_chat_t *chat)
Get a subtitle for a chat.
Definition: dc_chat.c:171
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:1024
void dc_msg_set_duration(dc_msg_t *msg, int duration)
Set the duration associated with message object.
Definition: dc_msg.c:1150
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:589
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:835
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:1898
char * dc_initiate_key_transfer(dc_context_t *context)
Initiate Autocrypt Setup Transfer.
Definition: dc_imex.c:444
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:2501
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:1168
size_t dc_array_get_cnt(const dc_array_t *array)
Find out the number of items in an array.
Definition: dc_array.c:233
time_t dc_msg_get_received_timestamp(const dc_msg_t *msg)
Get message receive time.
Definition: dc_msg.c:256
void dc_close(dc_context_t *context)
Close context database opened by dc_open().
Definition: dc_context.c:352
char * dc_get_config(dc_context_t *context, const char *key)
Get a configuration option.
Definition: dc_context.c:583
void dc_interrupt_imap_idle(dc_context_t *context)
Interrupt waiting for imap-jobs.
Definition: dc_job.c:800
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:2396
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:553
char * dc_msg_get_setupcodebegin(const dc_msg_t *msg)
Get the first characters of the setup code.
Definition: dc_msg.c:776
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:1636
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:934
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:783
void dc_delete_msgs(dc_context_t *context, const uint32_t *msg_ids, int msg_cnt)
Delete messages.
Definition: dc_msg.c:1743
int dc_chat_is_unpromoted(const dc_chat_t *chat)
Check if a group chat is still unpromoted.
Definition: dc_chat.c:346
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:1372
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:662
int dc_get_blocked_cnt(dc_context_t *context)
Get the number of blocked contacts.
Definition: dc_contact.c:1191
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
int dc_msg_is_starred(const dc_msg_t *msg)
Check if a message is starred.
Definition: dc_msg.c:670
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_lot_t * dc_check_qr(dc_context_t *context, const char *qr)
Check a scanned QR code.
Definition: dc_qr.c:37
int dc_chat_get_archived(const dc_chat_t *chat)
Get archived state.
Definition: dc_chat.c:317
int dc_msg_get_width(const dc_msg_t *msg)
Get width of image or video.
Definition: dc_msg.c:494
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:622
An object containing a set of values.
void dc_msg_set_text(dc_msg_t *msg, const char *text)
Set the text of a message object.
Definition: dc_msg.c:1086
void dc_perform_imap_jobs(dc_context_t *context)
Execute pending imap-jobs.
Definition: dc_job.c:681
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:836
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:950
time_t dc_msg_get_timestamp(const dc_msg_t *msg)
Get message sending time.
Definition: dc_msg.c:235
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:1415
void dc_archive_chat(dc_context_t *context, uint32_t chat_id, int archive)
Archive or unarchive a chat.
Definition: dc_chat.c:1462
uint32_t dc_chat_get_color(const dc_chat_t *chat)
Get a color for the chat.
Definition: dc_chat.c:274
dc_contact_t * dc_get_contact(dc_context_t *context, uint32_t contact_id)
Get a single contact object.
Definition: dc_contact.c:1143
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:613
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:1138
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:519
void dc_perform_smtp_idle(dc_context_t *context)
Wait for smtp-jobs.
Definition: dc_job.c:1054
const uintptr_t * dc_array_get_raw(const dc_array_t *array)
Get raw pointer to the data.
Definition: dc_array.c:337
int dc_delete_contact(dc_context_t *context, uint32_t contact_id)
Delete a contact.
Definition: dc_contact.c:1398
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:1109
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:1336
int dc_chat_is_self_talk(const dc_chat_t *chat)
Check if a chat is a self talk.
Definition: dc_chat.c:381
int dc_set_chat_name(dc_context_t *context, uint32_t chat_id, const char *new_name)
Set group name.
Definition: dc_chat.c:1746
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:629
void dc_lot_unref(dc_lot_t *set)
Frees an object containing a set of parameters.
Definition: dc_lot.c:32
void dc_configure(dc_context_t *context)
Configure a context.
Definition: dc_configure.c:1088
void dc_stop_ongoing_process(dc_context_t *context)
Signal an ongoing process to stop.
Definition: dc_configure.c:1192
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:1181