 |
Delta Chat Core C-API
|
1 #ifndef __DELTACHAT_H__
2 #define __DELTACHAT_H__
14 #define DC_VERSION_STR "0.45.0"
231 char* dc_get_version_str (
void);
233 void dc_no_compound_msgs (
void);
261 #define DC_GCL_ARCHIVED_ONLY 0x01
262 #define DC_GCL_NO_SPECIALS 0x02
263 #define DC_GCL_ADD_ALLDONE_HINT 0x04
278 #define DC_GCM_ADDDAYMARKER 0x01
323 #define DC_GCL_VERIFIED_ONLY 0x01
324 #define DC_GCL_ADD_SELF 0x02
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
346 #define DC_EMPTY_MVBOX 0x01
347 #define DC_EMPTY_INBOX 0x02
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
384 void dc_array_add_uint (
dc_array_t*, uintptr_t);
402 int dc_array_search_id (
const dc_array_t*, uint32_t needle,
size_t* indx);
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.
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
501 #define DC_MSG_ID_MARKER1 1
502 #define DC_MSG_ID_DAYMARKER 9
503 #define DC_MSG_ID_LAST_SPECIAL 9
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
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()
580 #define DC_CONTACT_ID_SELF 1
581 #define DC_CONTACT_ID_DEVICE 2
582 #define DC_CONTACT_ID_LAST_SPECIAL 9
610 #define DC_TEXT1_DRAFT 1
611 #define DC_TEXT1_USERNAME 2
612 #define DC_TEXT1_SELF 3
652 #define DC_MSG_TEXT 10
661 #define DC_MSG_IMAGE 20
669 #define DC_MSG_GIF 21
677 #define DC_MSG_AUDIO 40
686 #define DC_MSG_VOICE 41
697 #define DC_MSG_VIDEO 50
705 #define DC_MSG_FILE 60
730 #define DC_LP_AUTH_OAUTH2 0x2
737 #define DC_LP_AUTH_NORMAL 0x4
744 #define DC_LP_IMAP_SOCKET_STARTTLS 0x100
751 #define DC_LP_IMAP_SOCKET_SSL 0x200
758 #define DC_LP_IMAP_SOCKET_PLAIN 0x400
765 #define DC_LP_SMTP_SOCKET_STARTTLS 0x10000
772 #define DC_LP_SMTP_SOCKET_SSL 0x20000
779 #define DC_LP_SMTP_SOCKET_PLAIN 0x40000
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
815 #define DC_EVENT_INFO 100
826 #define DC_EVENT_SMTP_CONNECTED 101
837 #define DC_EVENT_IMAP_CONNECTED 102
847 #define DC_EVENT_SMTP_MESSAGE_SENT 103
861 #define DC_EVENT_WARNING 300
883 #define DC_EVENT_ERROR 400
907 #define DC_EVENT_ERROR_NETWORK 401
923 #define DC_EVENT_ERROR_SELF_NOT_IN_GROUP 410
937 #define DC_EVENT_MSGS_CHANGED 2000
950 #define DC_EVENT_INCOMING_MSG 2005
961 #define DC_EVENT_MSG_DELIVERED 2010
972 #define DC_EVENT_MSG_FAILED 2012
983 #define DC_EVENT_MSG_READ 2015
996 #define DC_EVENT_CHAT_MODIFIED 2020
1006 #define DC_EVENT_CONTACTS_CHANGED 2030
1019 #define DC_EVENT_LOCATION_CHANGED 2035
1029 #define DC_EVENT_CONFIGURE_PROGRESS 2041
1039 #define DC_EVENT_IMEX_PROGRESS 2051
1054 #define DC_EVENT_IMEX_FILE_WRITTEN 2052
1072 #define DC_EVENT_SECUREJOIN_INVITER_PROGRESS 2060
1088 #define DC_EVENT_SECUREJOIN_JOINER_PROGRESS 2061
1106 #define DC_EVENT_GET_STRING 2091
1123 #define DC_EVENT_HTTP_GET 2100
1141 #define DC_EVENT_HTTP_POST 2110
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)
1162 #define DC_SHOW_EMAILS_OFF 0
1163 #define DC_SHOW_EMAILS_ACCEPTED_CONTACTS 1
1164 #define DC_SHOW_EMAILS_ALL 2
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
1231 #endif // __DELTACHAT_H__
dc_array_t * dc_get_blocked_contacts(dc_context_t *context)
Get blocked contacts.
Definition: dc_contact.c:1114
char * dc_msg_get_setupcodebegin(const dc_msg_t *msg)
Get the first characters of the setup code.
Definition: dc_msg.c:798
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
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_msg_set_text(dc_msg_t *msg, const char *text)
Set the text of a message object.
Definition: dc_msg.c:1104
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_perform_sentbox_fetch(dc_context_t *context)
Fetch new messages from the Sent folder, if any.
Definition: dc_job.c:1092
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
time_t dc_msg_get_timestamp(const dc_msg_t *msg)
Get message sending time.
Definition: dc_msg.c:238
int dc_chat_is_self_talk(const dc_chat_t *chat)
Check if a chat is a self talk.
Definition: dc_chat.c:382
void dc_stop_ongoing_process(dc_context_t *context)
Signal an ongoing process to stop.
Definition: dc_configure.c:1227
int dc_chat_is_verified(const dc_chat_t *chat)
Check if a chat is verified.
Definition: dc_chat.c:365
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
time_t dc_lot_get_timestamp(const dc_lot_t *lot)
Get the associated timestamp.
Definition: dc_lot.c:169
void dc_perform_mvbox_fetch(dc_context_t *context)
Fetch new messages from the MVBOX, if any.
Definition: dc_job.c:1017
void dc_perform_imap_jobs(dc_context_t *context)
Execute pending imap-jobs.
Definition: dc_job.c:839
int dc_msg_get_duration(const dc_msg_t *msg)
Get the duration of audio or video.
Definition: dc_msg.c:559
char * dc_chat_get_profile_image(const dc_chat_t *chat)
Get the chat's profile image.
Definition: dc_chat.c:232
void dc_chatlist_unref(dc_chatlist_t *chatlist)
Free a chatlist object.
Definition: dc_chatlist.c:40
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
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
void dc_context_unref(dc_context_t *context)
Free a context object.
Definition: dc_context.c:243
int dc_chat_get_type(const dc_chat_t *chat)
Get chat type.
Definition: dc_chat.c:130
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_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
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
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_interrupt_imap_idle(dc_context_t *context)
Interrupt waiting for imap-jobs.
Definition: dc_job.c:958
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
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
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
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
void dc_lot_unref(dc_lot_t *set)
Frees an object containing a set of parameters.
Definition: dc_lot.c:32
int dc_msg_get_viewtype(const dc_msg_t *msg)
Get the type of the message.
Definition: dc_msg.c:174
char * dc_initiate_key_transfer(dc_context_t *context)
Initiate Autocrypt Setup Transfer.
Definition: dc_imex.c:347
char * dc_msg_get_filemime(const dc_msg_t *msg)
Get mime type of the file.
Definition: dc_msg.c:442
void dc_interrupt_sentbox_idle(dc_context_t *context)
Interrupt waiting for messages or jobs in the SENTBOX-thread.
Definition: dc_job.c:1130
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_is_configured(const dc_context_t *context)
Check if the context is already configured.
Definition: dc_configure.c:1146
int dc_lot_get_text1_meaning(const dc_lot_t *lot)
Get the meaning of the first string.
Definition: dc_lot.c:115
dc_contact_t * dc_get_contact(dc_context_t *context, uint32_t contact_id)
Get a single contact object.
Definition: dc_contact.c:1151
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
int dc_delete_contact(dc_context_t *context, uint32_t contact_id)
Delete a contact.
Definition: dc_contact.c:1406
int dc_lot_get_state(const dc_lot_t *lot)
Get the associated state.
Definition: dc_lot.c:133
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
void dc_delete_all_locations(dc_context_t *context)
Delete all locations on the current device.
Definition: dc_location.c:909
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_lot_t * dc_check_qr(dc_context_t *context, const char *qr)
Check a scanned QR code.
Definition: dc_qr.c:37
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_msg_latefiling_mediasize(dc_msg_t *msg, int width, int height, int duration)
Late filing information to a message.
Definition: dc_msg.c:1227
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
char * dc_chat_get_name(const dc_chat_t *chat)
Get name of a chat.
Definition: dc_chat.c:152
void dc_chat_unref(dc_chat_t *chat)
Free a chat object.
Definition: dc_chat.c:45
int dc_msg_is_starred(const dc_msg_t *msg)
Check if a message is starred.
Definition: dc_msg.c:692
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
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
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
time_t dc_msg_get_received_timestamp(const dc_msg_t *msg)
Get message receive time.
Definition: dc_msg.c:259
int dc_msg_get_width(const dc_msg_t *msg)
Get width of image or video.
Definition: dc_msg.c:516
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
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_perform_mvbox_idle(dc_context_t *context)
Wait for messages or jobs in the MVBOX-thread.
Definition: dc_job.c:1041
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_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
void dc_close(dc_context_t *context)
Close context database opened by dc_open().
Definition: dc_context.c:362
int dc_msg_get_height(const dc_msg_t *msg)
Get height of image or video.
Definition: dc_msg.c:539
char * dc_lot_get_text2(const dc_lot_t *lot)
Get second string.
Definition: dc_lot.c:97
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
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
void dc_perform_smtp_idle(dc_context_t *context)
Wait for smtp-jobs.
Definition: dc_job.c:1212
void dc_perform_smtp_jobs(dc_context_t *context)
Execute pending smtp-jobs.
Definition: dc_job.c:1176
void dc_msg_unref(dc_msg_t *msg)
Free a message object.
Definition: dc_msg.c:63
uint64_t dc_msg_get_filebytes(const dc_msg_t *msg)
Get the size of the file.
Definition: dc_msg.c:480
void dc_interrupt_mvbox_idle(dc_context_t *context)
Interrupt waiting for MVBOX-fetch.
Definition: dc_job.c:1067
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_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
char * dc_get_contact_encrinfo(dc_context_t *context, uint32_t contact_id)
Get encryption info for a contact.
Definition: dc_contact.c:1315
int dc_chat_is_unpromoted(const dc_chat_t *chat)
Check if a group chat is still unpromoted.
Definition: dc_chat.c:347
void dc_perform_imap_idle(dc_context_t *context)
Wait for messages or jobs.
Definition: dc_job.c:907
void dc_imex(dc_context_t *context, int what, const char *param1, const char *param2)
Import/export things.
Definition: dc_imex.c:1040
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
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
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_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
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_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
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
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_has_deviating_timestamp(const dc_msg_t *msg)
Check if a message has a deviating timestamp.
Definition: dc_msg.c:306
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
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
char * dc_get_info(dc_context_t *context)
Get information about the context.
Definition: dc_context.c:737
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
uint32_t dc_chat_get_id(const dc_chat_t *chat)
Get chat ID.
Definition: dc_chat.c:101
void dc_interrupt_smtp_idle(dc_context_t *context)
Interrupt waiting for smtp-jobs.
Definition: dc_job.c:1263
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
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_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
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_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_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_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_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
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
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_context_t * dc_chatlist_get_context(dc_chatlist_t *chatlist)
Helper function to get the associated context object.
Definition: dc_chatlist.c:228
int dc_chat_get_archived(const dc_chat_t *chat)
Get archived state.
Definition: dc_chat.c:318
void dc_configure(dc_context_t *context)
Configure a context.
Definition: dc_configure.c:1123
int dc_msg_is_increation(const dc_msg_t *msg)
Check if a message is still in creation.
Definition: dc_msg.c:1070
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
char * dc_chat_get_subtitle(const dc_chat_t *chat)
Get a subtitle for a chat.
Definition: dc_chat.c:172
int dc_add_address_book(dc_context_t *context, const char *adr_book)
Add a number of contacts.
Definition: dc_contact.c:891
uint32_t dc_lot_get_id(const dc_lot_t *lot)
Get the associated ID.
Definition: dc_lot.c:149
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
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
char * dc_get_blobdir(const dc_context_t *context)
Get the blob directory.
Definition: dc_context.c:410
time_t dc_msg_get_sort_timestamp(const dc_msg_t *msg)
Get message time used for sorting.
Definition: dc_msg.c:282
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
int dc_msg_is_setupmessage(const dc_msg_t *msg)
Check if the message is an Autocrypt Setup Message.
Definition: dc_msg.c:774
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_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
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
const uintptr_t * dc_array_get_raw(const dc_array_t *array)
Get raw pointer to the data.
Definition: dc_array.c:543
void * dc_get_userdata(dc_context_t *context)
Get user data associated with a context object.
Definition: dc_context.c:285
void dc_perform_imap_fetch(dc_context_t *context)
Fetch new messages, if any.
Definition: dc_job.c:867
int dc_msg_get_state(const dc_msg_t *msg)
Get the state of a message.
Definition: dc_msg.c:213
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
char * dc_msg_get_filename(const dc_msg_t *msg)
Get base file name without path.
Definition: dc_msg.c:411
int dc_open(dc_context_t *context, const char *dbfile, const char *blobdir)
Open context database.
Definition: dc_context.c:309
int dc_is_open(const dc_context_t *context)
Check if the context database is open.
Definition: dc_context.c:392
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
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
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_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
int dc_msg_is_forwarded(const dc_msg_t *msg)
Check if the message is a forwarded message.
Definition: dc_msg.c:717
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
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
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
void dc_delete_chat(dc_context_t *context, uint32_t chat_id)
Delete a chat.
Definition: dc_chat.c:1599
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
uint32_t dc_msg_get_id(const dc_msg_t *msg)
Get the ID of the message.
Definition: dc_msg.c:115
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
void dc_openssl_init_not_required(void)
Skip OpenSSL initialisation.
Definition: dc_openssl.c:30
int dc_set_location(dc_context_t *context, double latitude, double longitude, double accuracy)
Set current location.
Definition: dc_location.c:716
int dc_msg_is_sent(const dc_msg_t *msg)
Check if a message was sent successfully.
Definition: dc_msg.c:671
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
int dc_get_blocked_cnt(dc_context_t *context)
Get the number of blocked contacts.
Definition: dc_contact.c:1199
void dc_msg_set_duration(dc_msg_t *msg, int duration)
Set the duration associated with message object.
Definition: dc_msg.c:1168
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
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
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_delete_msgs(dc_context_t *context, const uint32_t *msg_ids, int msg_cnt)
Delete messages.
Definition: dc_msg.c:1829
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
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
void dc_marknoticed_all_chats(dc_context_t *context)
Same as dc_marknoticed_chat() but for all chats.
Definition: dc_chat.c:678
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
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_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_context_t *context, int viewtype)
Create new message object.
Definition: dc_msg.c:23
uint32_t dc_chat_get_color(const dc_chat_t *chat)
Get a color for the chat.
Definition: dc_chat.c:275
int dc_set_config(dc_context_t *context, const char *key, const char *value)
Configure the context.
Definition: dc_context.c:536
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_array_unref(dc_array_t *array)
Free an array object.
Definition: dc_array.c:54
void dc_perform_sentbox_idle(dc_context_t *context)
Wait for messages or jobs in the SENTBOX-thread.
Definition: dc_job.c:1112
char * dc_msg_get_text(const dc_msg_t *msg)
Get the text of the message.
Definition: dc_msg.c:355