From c42477d9c45ce2fb1829bc983498a56663cab015 Mon Sep 17 00:00:00 2001 From: "B. Petersen" Date: Mon, 4 Dec 2017 17:45:17 +0100 Subject: [PATCH] doxygen --- docs/html/functions.html | 6 ++ docs/html/functions_func.html | 6 ++ docs/html/mrmailbox_8h_source.html | 69 ++++++------- docs/html/mrmimefactory_8h_source.html | 2 +- docs/html/mrmsg_8h_source.html | 7 +- docs/html/mrstock_8h_source.html | 2 +- docs/html/mrtools_8h_source.html | 2 +- docs/html/search/all_1.js | 2 + docs/html/search/functions_0.js | 2 + docs/html/structmrmailbox__t-members.html | 119 +++++++++++----------- docs/html/structmrmailbox__t.html | 112 ++++++++++++++------ docs/html/structmrmsg__t-members.html | 9 +- docs/html/structmrmsg__t.html | 30 ++++++ 13 files changed, 233 insertions(+), 135 deletions(-) diff --git a/docs/html/functions.html b/docs/html/functions.html index adfcba24..3bee4ac5 100644 --- a/docs/html/functions.html +++ b/docs/html/functions.html @@ -225,6 +225,9 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • mrmailbox_connect() : mrmailbox_t
  • +
  • mrmailbox_continue_key_transfer() +: mrmailbox_t +
  • mrmailbox_create_chat_by_contact_id() : mrmailbox_t
  • @@ -453,6 +456,9 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • mrmsg_is_increation() : mrmsg_t
  • +
  • mrmsg_is_setupmessage() +: mrmsg_t +
  • mrmsg_is_starred() : mrmsg_t
  • diff --git a/docs/html/functions_func.html b/docs/html/functions_func.html index bba8b2e0..fe8619fb 100644 --- a/docs/html/functions_func.html +++ b/docs/html/functions_func.html @@ -193,6 +193,9 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • mrmailbox_connect() : mrmailbox_t
  • +
  • mrmailbox_continue_key_transfer() +: mrmailbox_t +
  • mrmailbox_create_chat_by_contact_id() : mrmailbox_t
  • @@ -418,6 +421,9 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • mrmsg_is_increation() : mrmsg_t
  • +
  • mrmsg_is_setupmessage() +: mrmsg_t +
  • mrmsg_is_starred() : mrmsg_t
  • diff --git a/docs/html/mrmailbox_8h_source.html b/docs/html/mrmailbox_8h_source.html index b556ee4d..721900a2 100644 --- a/docs/html/mrmailbox_8h_source.html +++ b/docs/html/mrmailbox_8h_source.html @@ -89,46 +89,47 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    mrmailbox.h
    -
    1 /*******************************************************************************
    2  *
    3  * Delta Chat Core
    4  * Copyright (C) 2017 Björn Petersen
    5  * Contact: r10s@b44t.com, http://b44t.com
    6  *
    7  * This program is free software: you can redistribute it and/or modify it under
    8  * the terms of the GNU General Public License as published by the Free Software
    9  * Foundation, either version 3 of the License, or (at your option) any later
    10  * version.
    11  *
    12  * This program is distributed in the hope that it will be useful, but WITHOUT
    13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    14  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
    15  * details.
    16  *
    17  * You should have received a copy of the GNU General Public License along with
    18  * this program. If not, see http://www.gnu.org/licenses/ .
    19  *
    20  ******************************************************************************/
    21 
    22 
    23 #ifndef __MRMAILBOX_H__
    24 #define __MRMAILBOX_H__
    25 #ifdef __cplusplus
    26 extern "C" {
    27 #endif
    28 
    29 
    30 #define MR_VERSION_MAJOR 0
    31 #define MR_VERSION_MINOR 10
    32 #define MR_VERSION_REVISION 0
    33 
    34 
    145 #include <pthread.h>
    146 #include <libetpan/libetpan.h> /* defines uint16_t */
    147 #include "mrarray.h"
    148 #include "mrchatlist.h"
    149 #include "mrchat.h"
    150 #include "mrmsg.h"
    151 #include "mrcontact.h"
    152 #include "mrlot.h"
    153 #include "mrparam.h"
    154 #include "mrevent.h"
    155 
    156 typedef struct mrmailbox_t mrmailbox_t;
    157 typedef struct mrimap_t mrimap_t;
    158 typedef struct mrsmtp_t mrsmtp_t;
    159 typedef struct mrsqlite3_t mrsqlite3_t;
    160 typedef struct mrjob_t mrjob_t;
    161 typedef struct mrmimeparser_t mrmimeparser_t;
    162 
    163 
    179 typedef uintptr_t (*mrmailboxcb_t) (mrmailbox_t*, int event, uintptr_t data1, uintptr_t data2);
    180 
    181 
    189 typedef struct mrmailbox_t
    190 {
    191  void* m_userdata;
    194  char* m_dbfile;
    195  char* m_blobdir;
    197  mrsqlite3_t* m_sql;
    198  mrimap_t* m_imap;
    199  mrsmtp_t* m_smtp;
    201  pthread_t m_job_thread;
    202  pthread_cond_t m_job_cond;
    203  pthread_mutex_t m_job_condmutex;
    204  int m_job_condflag;
    205  int m_job_do_exit;
    207  mrmailboxcb_t m_cb;
    209  char* m_os_name;
    211  uint32_t m_cmdline_sel_chat_id;
    213  int m_wake_lock;
    214  pthread_mutex_t m_wake_lock_critical;
    216  int m_e2ee_enabled;
    218  #define MR_LOG_RINGBUF_SIZE 200
    219  pthread_mutex_t m_log_ringbuf_critical;
    220  char* m_log_ringbuf[MR_LOG_RINGBUF_SIZE];
    222  time_t m_log_ringbuf_times[MR_LOG_RINGBUF_SIZE];
    224  int m_log_ringbuf_pos;
    226 } mrmailbox_t;
    227 
    228 
    229 /* create/open/connect */
    230 mrmailbox_t* mrmailbox_new (mrmailboxcb_t, void* userdata, const char* os_name);
    231 void mrmailbox_unref (mrmailbox_t*);
    232 
    233 int mrmailbox_open (mrmailbox_t*, const char* dbfile, const char* blobdir);
    234 void mrmailbox_close (mrmailbox_t*);
    235 int mrmailbox_is_open (const mrmailbox_t*);
    236 
    237 int mrmailbox_set_config (mrmailbox_t*, const char* key, const char* value);
    238 char* mrmailbox_get_config (mrmailbox_t*, const char* key, const char* def);
    239 int mrmailbox_set_config_int (mrmailbox_t*, const char* key, int32_t value);
    240 int32_t mrmailbox_get_config_int (mrmailbox_t*, const char* key, int32_t def);
    241 char* mrmailbox_get_version_str (void);
    242 
    243 int mrmailbox_configure_and_connect(mrmailbox_t*);
    244 void mrmailbox_configure_cancel (mrmailbox_t*);
    245 int mrmailbox_is_configured (mrmailbox_t*);
    246 
    247 void mrmailbox_connect (mrmailbox_t*);
    248 void mrmailbox_disconnect (mrmailbox_t*);
    249 
    250 char* mrmailbox_get_info (mrmailbox_t*);
    251 
    252 
    253 /* Handle chatlists */
    254 #define MR_GCL_ARCHIVED_ONLY 0x01
    255 #define MR_GCL_NO_SPECIALS 0x02
    256 mrchatlist_t* mrmailbox_get_chatlist (mrmailbox_t*, int flags, const char* query);
    257 
    258 
    259 /* Handle chats */
    260 uint32_t mrmailbox_create_chat_by_contact_id (mrmailbox_t*, uint32_t contact_id);
    261 uint32_t mrmailbox_get_chat_id_by_contact_id (mrmailbox_t*, uint32_t contact_id);
    262 
    263 uint32_t mrmailbox_send_text_msg (mrmailbox_t*, uint32_t chat_id, const char* text_to_send);
    264 uint32_t mrmailbox_send_image_msg (mrmailbox_t*, uint32_t chat_id, const char* file, const char* filemime, int width, int height);
    265 uint32_t mrmailbox_send_video_msg (mrmailbox_t*, uint32_t chat_id, const char* file, const char* filemime, int width, int height, int duration);
    266 uint32_t mrmailbox_send_voice_msg (mrmailbox_t*, uint32_t chat_id, const char* file, const char* filemime, int duration);
    267 uint32_t mrmailbox_send_audio_msg (mrmailbox_t*, uint32_t chat_id, const char* file, const char* filemime, int duration, const char* author, const char* trackname);
    268 uint32_t mrmailbox_send_file_msg (mrmailbox_t*, uint32_t chat_id, const char* file, const char* filemime);
    269 uint32_t mrmailbox_send_vcard_msg (mrmailbox_t*, uint32_t chat_id, uint32_t contact_id);
    270 void mrmailbox_set_draft (mrmailbox_t*, uint32_t chat_id, const char*);
    271 
    272 #define MR_GCM_ADDDAYMARKER 0x01
    273 mrarray_t* mrmailbox_get_chat_msgs (mrmailbox_t*, uint32_t chat_id, uint32_t flags, uint32_t marker1before);
    274 int mrmailbox_get_total_msg_count (mrmailbox_t*, uint32_t chat_id);
    275 int mrmailbox_get_fresh_msg_count (mrmailbox_t*, uint32_t chat_id);
    276 mrarray_t* mrmailbox_get_fresh_msgs (mrmailbox_t*);
    277 void mrmailbox_marknoticed_chat (mrmailbox_t*, uint32_t chat_id);
    278 mrarray_t* mrmailbox_get_chat_media (mrmailbox_t*, uint32_t chat_id, int msg_type, int or_msg_type);
    279 uint32_t mrmailbox_get_next_media (mrmailbox_t*, uint32_t curr_msg_id, int dir);
    280 
    281 void mrmailbox_archive_chat (mrmailbox_t*, uint32_t chat_id, int archive);
    282 void mrmailbox_delete_chat (mrmailbox_t*, uint32_t chat_id);
    283 
    284 mrarray_t* mrmailbox_get_chat_contacts (mrmailbox_t*, uint32_t chat_id);
    285 mrarray_t* mrmailbox_search_msgs (mrmailbox_t*, uint32_t chat_id, const char* query);
    286 
    287 mrchat_t* mrmailbox_get_chat (mrmailbox_t*, uint32_t chat_id);
    288 
    289 
    290 /* Handle group chats */
    291 uint32_t mrmailbox_create_group_chat (mrmailbox_t*, const char* name);
    292 int mrmailbox_is_contact_in_chat (mrmailbox_t*, uint32_t chat_id, uint32_t contact_id);
    293 int mrmailbox_add_contact_to_chat (mrmailbox_t*, uint32_t chat_id, uint32_t contact_id);
    294 int mrmailbox_remove_contact_from_chat (mrmailbox_t*, uint32_t chat_id, uint32_t contact_id);
    295 int mrmailbox_set_chat_name (mrmailbox_t*, uint32_t chat_id, const char* name);
    296 int mrmailbox_set_chat_profile_image (mrmailbox_t*, uint32_t chat_id, const char* image);
    297 
    298 
    299 /* Handle messages */
    300 char* mrmailbox_get_msg_info (mrmailbox_t*, uint32_t msg_id);
    301 void mrmailbox_delete_msgs (mrmailbox_t*, const uint32_t* msg_ids, int msg_cnt);
    302 void mrmailbox_forward_msgs (mrmailbox_t*, const uint32_t* msg_ids, int msg_cnt, uint32_t chat_id);
    303 void mrmailbox_marknoticed_contact (mrmailbox_t*, uint32_t contact_id);
    304 void mrmailbox_markseen_msgs (mrmailbox_t*, const uint32_t* msg_ids, int msg_cnt);
    305 void mrmailbox_star_msgs (mrmailbox_t*, const uint32_t* msg_ids, int msg_cnt, int star);
    306 mrmsg_t* mrmailbox_get_msg (mrmailbox_t*, uint32_t msg_id);
    307 
    308 
    309 /* Handle contacts */
    310 uint32_t mrmailbox_create_contact (mrmailbox_t*, const char* name, const char* addr);
    311 int mrmailbox_add_address_book (mrmailbox_t*, const char*);
    312 mrarray_t* mrmailbox_get_known_contacts (mrmailbox_t*, const char* query);
    313 int mrmailbox_get_blocked_count (mrmailbox_t*);
    315 void mrmailbox_block_contact (mrmailbox_t*, uint32_t contact_id, int block);
    316 char* mrmailbox_get_contact_encrinfo (mrmailbox_t*, uint32_t contact_id);
    317 int mrmailbox_delete_contact (mrmailbox_t*, uint32_t contact_id);
    318 mrcontact_t* mrmailbox_get_contact (mrmailbox_t*, uint32_t contact_id);
    319 
    320 
    321 /* Import/export and Tools */
    322 #define MR_IMEX_EXPORT_SELF_KEYS 1 /* param1 is a directory where the keys are written to */
    323 #define MR_IMEX_IMPORT_SELF_KEYS 2 /* param1 is a directory where the keys are searched in and read from */
    324 #define MR_IMEX_EXPORT_BACKUP 11 /* param1 is a directory where the backup is written to */
    325 #define MR_IMEX_IMPORT_BACKUP 12 /* param1 is the file with the backup to import */
    326 #define MR_BAK_PREFIX "delta-chat"
    327 #define MR_BAK_SUFFIX "bak"
    328 int mrmailbox_imex (mrmailbox_t*, int what, const char* param1, const char* param2);
    329 void mrmailbox_imex_cancel (mrmailbox_t*);
    330 char* mrmailbox_imex_has_backup (mrmailbox_t*, const char* dir);
    331 int mrmailbox_check_password (mrmailbox_t*, const char* pw);
    332 char* mrmailbox_initiate_key_transfer(mrmailbox_t*);
    333 void mrmailbox_heartbeat (mrmailbox_t*);
    334 
    335 
    336 /* logging */
    337 void mrmailbox_log_error (mrmailbox_t*, int code, const char* msg, ...);
    338 void mrmailbox_log_error_if (int* condition, mrmailbox_t*, int code, const char* msg, ...);
    339 void mrmailbox_log_warning (mrmailbox_t*, int code, const char* msg, ...);
    340 void mrmailbox_log_info (mrmailbox_t*, int code, const char* msg, ...);
    341 void mrmailbox_log_vprintf (mrmailbox_t*, int event, int code, const char* msg, va_list);
    342 int mrmailbox_get_thread_index (void);
    343 
    344 
    345 /* error codes */
    346 #define MR_ERR_SELF_NOT_IN_GROUP 1
    347 #define MR_ERR_NONETWORK 2
    348 
    349 
    350 /* deprecated functions */
    351 int mrchat_set_draft (mrchat_t*, const char* msg); /* deprecated - use mrmailbox_set_draft() instead */
    352 #define mrpoortext_t mrlot_t
    353 #define mrpoortext_unref mrlot_unref
    354 
    355 
    356 /* library-internal */
    357 uint32_t mrmailbox_send_msg_object (mrmailbox_t*, uint32_t chat_id, mrmsg_t*);
    358 void mrmailbox_connect_to_imap (mrmailbox_t*, mrjob_t*);
    359 void mrmailbox_wake_lock (mrmailbox_t*);
    360 void mrmailbox_wake_unlock (mrmailbox_t*);
    361 int mrmailbox_poke_eml_file (mrmailbox_t*, const char* file);
    362 int mrmailbox_is_reply_to_known_message__ (mrmailbox_t*, mrmimeparser_t*);
    363 int mrmailbox_is_reply_to_messenger_message__ (mrmailbox_t*, mrmimeparser_t*);
    364 time_t mrmailbox_correct_bad_timestamp__ (mrmailbox_t* ths, uint32_t chat_id, uint32_t from_id, time_t desired_timestamp, int is_fresh_msg);
    365 void mrmailbox_add_or_lookup_contacts_by_mailbox_list__(mrmailbox_t* ths, struct mailimf_mailbox_list* mb_list, int origin, mrarray_t* ids, int* check_self);
    366 void mrmailbox_add_or_lookup_contacts_by_address_list__(mrmailbox_t* ths, struct mailimf_address_list* adr_list, int origin, mrarray_t* ids, int* check_self);
    367 int mrmailbox_get_archived_count__ (mrmailbox_t*);
    368 int mrmailbox_reset_tables (mrmailbox_t*, int bits); /* reset tables but leaves server configuration, 1=jobs, 2=e2ee, 8=rest but server config */
    369 size_t mrmailbox_get_real_contact_cnt__ (mrmailbox_t*);
    370 uint32_t mrmailbox_add_or_lookup_contact__ (mrmailbox_t*, const char* display_name /*can be NULL*/, const char* addr_spec, int origin, int* sth_modified);
    371 int mrmailbox_get_contact_origin__ (mrmailbox_t*, uint32_t id, int* ret_blocked);
    372 int mrmailbox_is_contact_blocked__ (mrmailbox_t*, uint32_t id);
    373 int mrmailbox_real_contact_exists__ (mrmailbox_t*, uint32_t id);
    374 int mrmailbox_contact_addr_equals__ (mrmailbox_t*, uint32_t contact_id, const char* other_addr);
    375 void mrmailbox_scaleup_contact_origin__ (mrmailbox_t*, uint32_t contact_id, int origin);
    376 void mrmailbox_unarchive_chat__ (mrmailbox_t*, uint32_t chat_id);
    377 size_t mrmailbox_get_chat_cnt__ (mrmailbox_t*);
    378 uint32_t mrmailbox_create_or_lookup_nchat_by_contact_id__ (mrmailbox_t*, uint32_t contact_id);
    379 uint32_t mrmailbox_lookup_real_nchat_by_contact_id__ (mrmailbox_t*, uint32_t contact_id);
    380 int mrmailbox_get_total_msg_count__ (mrmailbox_t*, uint32_t chat_id);
    381 int mrmailbox_get_fresh_msg_count__ (mrmailbox_t*, uint32_t chat_id);
    382 uint32_t mrmailbox_get_last_deaddrop_fresh_msg__ (mrmailbox_t*);
    383 void mrmailbox_send_msg_to_smtp (mrmailbox_t*, mrjob_t*);
    384 void mrmailbox_send_msg_to_imap (mrmailbox_t*, mrjob_t*);
    385 int mrmailbox_add_contact_to_chat__ (mrmailbox_t*, uint32_t chat_id, uint32_t contact_id);
    386 int mrmailbox_is_contact_in_chat__ (mrmailbox_t*, uint32_t chat_id, uint32_t contact_id);
    387 int mrmailbox_get_chat_contact_count__ (mrmailbox_t*, uint32_t chat_id);
    388 int mrmailbox_group_explicitly_left__ (mrmailbox_t*, const char* grpid);
    389 void mrmailbox_set_group_explicitly_left__ (mrmailbox_t*, const char* grpid);
    390 size_t mrmailbox_get_real_msg_cnt__ (mrmailbox_t*); /* the number of messages assigned to real chat (!=deaddrop, !=trash) */
    391 size_t mrmailbox_get_deaddrop_msg_cnt__ (mrmailbox_t*);
    392 int mrmailbox_rfc724_mid_cnt__ (mrmailbox_t*, const char* rfc724_mid);
    393 int mrmailbox_rfc724_mid_exists__ (mrmailbox_t*, const char* rfc724_mid, char** ret_server_folder, uint32_t* ret_server_uid);
    394 void mrmailbox_update_server_uid__ (mrmailbox_t*, const char* rfc724_mid, const char* server_folder, uint32_t server_uid);
    395 void mrmailbox_update_msg_chat_id__ (mrmailbox_t*, uint32_t msg_id, uint32_t chat_id);
    396 void mrmailbox_update_msg_state__ (mrmailbox_t*, uint32_t msg_id, int state);
    397 void mrmailbox_delete_msg_on_imap (mrmailbox_t* mailbox, mrjob_t* job);
    398 int mrmailbox_mdn_from_ext__ (mrmailbox_t*, uint32_t from_id, const char* rfc724_mid, uint32_t* ret_chat_id, uint32_t* ret_msg_id); /* returns 1 if an event should be send */
    399 void mrmailbox_send_mdn (mrmailbox_t*, mrjob_t* job);
    400 void mrmailbox_markseen_msg_on_imap (mrmailbox_t* mailbox, mrjob_t* job);
    401 void mrmailbox_markseen_mdn_on_imap (mrmailbox_t* mailbox, mrjob_t* job);
    402 
    403 
    404 /* library private: end-to-end-encryption */
    405 #define MR_E2EE_DEFAULT_ENABLED 1
    406 #define MR_MDNS_DEFAULT_ENABLED 1
    407 
    408 typedef struct mrmailbox_e2ee_helper_t {
    409  int m_encryption_successfull;
    410  void* m_cdata_to_free;
    411 } mrmailbox_e2ee_helper_t;
    412 
    413 void mrmailbox_e2ee_encrypt (mrmailbox_t*, const clist* recipients_addr, int e2ee_guaranteed, int encrypt_to_self, struct mailmime* in_out_message, mrmailbox_e2ee_helper_t*);
    414 int mrmailbox_e2ee_decrypt (mrmailbox_t*, struct mailmime* in_out_message, int* ret_validation_errors); /* returns 1 if sth. was decrypted, 0 in other cases */
    415 void mrmailbox_e2ee_thanks (mrmailbox_e2ee_helper_t*); /* frees data referenced by "mailmime" but not freed by mailmime_free(). After calling mre2ee_unhelp(), in_out_message cannot be used any longer! */
    416 int mrmailbox_ensure_secret_key_exists (mrmailbox_t*); /* makes sure, the private key exists, needed only for exporting keys and the case no message was sent before */
    417 char* mrmailbox_create_setup_code (mrmailbox_t*);
    418 int mrmailbox_render_setup_file (mrmailbox_t* mailbox, const char* passphrase, char** ret_msg);
    419 
    420 #ifdef __cplusplus
    421 } /* /extern "C" */
    422 #endif
    423 #endif /* __MRMAILBOX_H__ */
    int mrmailbox_add_address_book(mrmailbox_t *mailbox, const char *adr_book)
    Add a number of contacts.
    Definition: mrmailbox.c:4339
    -
    uint32_t mrmailbox_create_group_chat(mrmailbox_t *mailbox, const char *chat_name)
    Create a new group chat.
    Definition: mrmailbox.c:3627
    -
    uint32_t mrmailbox_create_contact(mrmailbox_t *mailbox, const char *name, const char *addr)
    Add a single contact.
    Definition: mrmailbox.c:4296
    -
    uint32_t mrmailbox_send_text_msg(mrmailbox_t *mailbox, uint32_t chat_id, const char *text_to_send)
    Send a simple text message a given chat.
    Definition: mrmailbox.c:3249
    +
    1 /*******************************************************************************
    2  *
    3  * Delta Chat Core
    4  * Copyright (C) 2017 Björn Petersen
    5  * Contact: r10s@b44t.com, http://b44t.com
    6  *
    7  * This program is free software: you can redistribute it and/or modify it under
    8  * the terms of the GNU General Public License as published by the Free Software
    9  * Foundation, either version 3 of the License, or (at your option) any later
    10  * version.
    11  *
    12  * This program is distributed in the hope that it will be useful, but WITHOUT
    13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    14  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
    15  * details.
    16  *
    17  * You should have received a copy of the GNU General Public License along with
    18  * this program. If not, see http://www.gnu.org/licenses/ .
    19  *
    20  ******************************************************************************/
    21 
    22 
    23 #ifndef __MRMAILBOX_H__
    24 #define __MRMAILBOX_H__
    25 #ifdef __cplusplus
    26 extern "C" {
    27 #endif
    28 
    29 
    30 #define MR_VERSION_MAJOR 0
    31 #define MR_VERSION_MINOR 10
    32 #define MR_VERSION_REVISION 0
    33 
    34 
    145 #include <pthread.h>
    146 #include <libetpan/libetpan.h> /* defines uint16_t */
    147 #include "mrarray.h"
    148 #include "mrchatlist.h"
    149 #include "mrchat.h"
    150 #include "mrmsg.h"
    151 #include "mrcontact.h"
    152 #include "mrlot.h"
    153 #include "mrparam.h"
    154 #include "mrevent.h"
    155 
    156 typedef struct mrmailbox_t mrmailbox_t;
    157 typedef struct mrimap_t mrimap_t;
    158 typedef struct mrsmtp_t mrsmtp_t;
    159 typedef struct mrsqlite3_t mrsqlite3_t;
    160 typedef struct mrjob_t mrjob_t;
    161 typedef struct mrmimeparser_t mrmimeparser_t;
    162 
    163 
    179 typedef uintptr_t (*mrmailboxcb_t) (mrmailbox_t*, int event, uintptr_t data1, uintptr_t data2);
    180 
    181 
    189 typedef struct mrmailbox_t
    190 {
    191  void* m_userdata;
    194  char* m_dbfile;
    195  char* m_blobdir;
    197  mrsqlite3_t* m_sql;
    198  mrimap_t* m_imap;
    199  mrsmtp_t* m_smtp;
    201  pthread_t m_job_thread;
    202  pthread_cond_t m_job_cond;
    203  pthread_mutex_t m_job_condmutex;
    204  int m_job_condflag;
    205  int m_job_do_exit;
    207  mrmailboxcb_t m_cb;
    209  char* m_os_name;
    211  uint32_t m_cmdline_sel_chat_id;
    213  int m_wake_lock;
    214  pthread_mutex_t m_wake_lock_critical;
    216  int m_e2ee_enabled;
    218  #define MR_LOG_RINGBUF_SIZE 200
    219  pthread_mutex_t m_log_ringbuf_critical;
    220  char* m_log_ringbuf[MR_LOG_RINGBUF_SIZE];
    222  time_t m_log_ringbuf_times[MR_LOG_RINGBUF_SIZE];
    224  int m_log_ringbuf_pos;
    226 } mrmailbox_t;
    227 
    228 
    229 /* create/open/connect */
    230 mrmailbox_t* mrmailbox_new (mrmailboxcb_t, void* userdata, const char* os_name);
    231 void mrmailbox_unref (mrmailbox_t*);
    232 
    233 int mrmailbox_open (mrmailbox_t*, const char* dbfile, const char* blobdir);
    234 void mrmailbox_close (mrmailbox_t*);
    235 int mrmailbox_is_open (const mrmailbox_t*);
    236 
    237 int mrmailbox_set_config (mrmailbox_t*, const char* key, const char* value);
    238 char* mrmailbox_get_config (mrmailbox_t*, const char* key, const char* def);
    239 int mrmailbox_set_config_int (mrmailbox_t*, const char* key, int32_t value);
    240 int32_t mrmailbox_get_config_int (mrmailbox_t*, const char* key, int32_t def);
    241 char* mrmailbox_get_version_str (void);
    242 
    243 int mrmailbox_configure_and_connect(mrmailbox_t*);
    244 void mrmailbox_configure_cancel (mrmailbox_t*);
    245 int mrmailbox_is_configured (mrmailbox_t*);
    246 
    247 void mrmailbox_connect (mrmailbox_t*);
    248 void mrmailbox_disconnect (mrmailbox_t*);
    249 
    250 char* mrmailbox_get_info (mrmailbox_t*);
    251 
    252 
    253 /* Handle chatlists */
    254 #define MR_GCL_ARCHIVED_ONLY 0x01
    255 #define MR_GCL_NO_SPECIALS 0x02
    256 mrchatlist_t* mrmailbox_get_chatlist (mrmailbox_t*, int flags, const char* query);
    257 
    258 
    259 /* Handle chats */
    260 uint32_t mrmailbox_create_chat_by_contact_id (mrmailbox_t*, uint32_t contact_id);
    261 uint32_t mrmailbox_get_chat_id_by_contact_id (mrmailbox_t*, uint32_t contact_id);
    262 
    263 uint32_t mrmailbox_send_text_msg (mrmailbox_t*, uint32_t chat_id, const char* text_to_send);
    264 uint32_t mrmailbox_send_image_msg (mrmailbox_t*, uint32_t chat_id, const char* file, const char* filemime, int width, int height);
    265 uint32_t mrmailbox_send_video_msg (mrmailbox_t*, uint32_t chat_id, const char* file, const char* filemime, int width, int height, int duration);
    266 uint32_t mrmailbox_send_voice_msg (mrmailbox_t*, uint32_t chat_id, const char* file, const char* filemime, int duration);
    267 uint32_t mrmailbox_send_audio_msg (mrmailbox_t*, uint32_t chat_id, const char* file, const char* filemime, int duration, const char* author, const char* trackname);
    268 uint32_t mrmailbox_send_file_msg (mrmailbox_t*, uint32_t chat_id, const char* file, const char* filemime);
    269 uint32_t mrmailbox_send_vcard_msg (mrmailbox_t*, uint32_t chat_id, uint32_t contact_id);
    270 void mrmailbox_set_draft (mrmailbox_t*, uint32_t chat_id, const char*);
    271 
    272 #define MR_GCM_ADDDAYMARKER 0x01
    273 mrarray_t* mrmailbox_get_chat_msgs (mrmailbox_t*, uint32_t chat_id, uint32_t flags, uint32_t marker1before);
    274 int mrmailbox_get_total_msg_count (mrmailbox_t*, uint32_t chat_id);
    275 int mrmailbox_get_fresh_msg_count (mrmailbox_t*, uint32_t chat_id);
    276 mrarray_t* mrmailbox_get_fresh_msgs (mrmailbox_t*);
    277 void mrmailbox_marknoticed_chat (mrmailbox_t*, uint32_t chat_id);
    278 mrarray_t* mrmailbox_get_chat_media (mrmailbox_t*, uint32_t chat_id, int msg_type, int or_msg_type);
    279 uint32_t mrmailbox_get_next_media (mrmailbox_t*, uint32_t curr_msg_id, int dir);
    280 
    281 void mrmailbox_archive_chat (mrmailbox_t*, uint32_t chat_id, int archive);
    282 void mrmailbox_delete_chat (mrmailbox_t*, uint32_t chat_id);
    283 
    284 mrarray_t* mrmailbox_get_chat_contacts (mrmailbox_t*, uint32_t chat_id);
    285 mrarray_t* mrmailbox_search_msgs (mrmailbox_t*, uint32_t chat_id, const char* query);
    286 
    287 mrchat_t* mrmailbox_get_chat (mrmailbox_t*, uint32_t chat_id);
    288 
    289 
    290 /* Handle group chats */
    291 uint32_t mrmailbox_create_group_chat (mrmailbox_t*, const char* name);
    292 int mrmailbox_is_contact_in_chat (mrmailbox_t*, uint32_t chat_id, uint32_t contact_id);
    293 int mrmailbox_add_contact_to_chat (mrmailbox_t*, uint32_t chat_id, uint32_t contact_id);
    294 int mrmailbox_remove_contact_from_chat (mrmailbox_t*, uint32_t chat_id, uint32_t contact_id);
    295 int mrmailbox_set_chat_name (mrmailbox_t*, uint32_t chat_id, const char* name);
    296 int mrmailbox_set_chat_profile_image (mrmailbox_t*, uint32_t chat_id, const char* image);
    297 
    298 
    299 /* Handle messages */
    300 char* mrmailbox_get_msg_info (mrmailbox_t*, uint32_t msg_id);
    301 void mrmailbox_delete_msgs (mrmailbox_t*, const uint32_t* msg_ids, int msg_cnt);
    302 void mrmailbox_forward_msgs (mrmailbox_t*, const uint32_t* msg_ids, int msg_cnt, uint32_t chat_id);
    303 void mrmailbox_marknoticed_contact (mrmailbox_t*, uint32_t contact_id);
    304 void mrmailbox_markseen_msgs (mrmailbox_t*, const uint32_t* msg_ids, int msg_cnt);
    305 void mrmailbox_star_msgs (mrmailbox_t*, const uint32_t* msg_ids, int msg_cnt, int star);
    306 mrmsg_t* mrmailbox_get_msg (mrmailbox_t*, uint32_t msg_id);
    307 
    308 
    309 /* Handle contacts */
    310 uint32_t mrmailbox_create_contact (mrmailbox_t*, const char* name, const char* addr);
    311 int mrmailbox_add_address_book (mrmailbox_t*, const char*);
    312 mrarray_t* mrmailbox_get_known_contacts (mrmailbox_t*, const char* query);
    313 int mrmailbox_get_blocked_count (mrmailbox_t*);
    315 void mrmailbox_block_contact (mrmailbox_t*, uint32_t contact_id, int block);
    316 char* mrmailbox_get_contact_encrinfo (mrmailbox_t*, uint32_t contact_id);
    317 int mrmailbox_delete_contact (mrmailbox_t*, uint32_t contact_id);
    318 mrcontact_t* mrmailbox_get_contact (mrmailbox_t*, uint32_t contact_id);
    319 
    320 
    321 /* Import/export and Tools */
    322 #define MR_IMEX_EXPORT_SELF_KEYS 1 /* param1 is a directory where the keys are written to */
    323 #define MR_IMEX_IMPORT_SELF_KEYS 2 /* param1 is a directory where the keys are searched in and read from */
    324 #define MR_IMEX_EXPORT_BACKUP 11 /* param1 is a directory where the backup is written to */
    325 #define MR_IMEX_IMPORT_BACKUP 12 /* param1 is the file with the backup to import */
    326 #define MR_BAK_PREFIX "delta-chat"
    327 #define MR_BAK_SUFFIX "bak"
    328 int mrmailbox_imex (mrmailbox_t*, int what, const char* param1, const char* param2);
    329 void mrmailbox_imex_cancel (mrmailbox_t*);
    330 char* mrmailbox_imex_has_backup (mrmailbox_t*, const char* dir);
    331 int mrmailbox_check_password (mrmailbox_t*, const char* pw);
    332 char* mrmailbox_initiate_key_transfer(mrmailbox_t*);
    333 int mrmailbox_continue_key_transfer(mrmailbox_t*, uint32_t msg_id, const char* setup_code);
    334 void mrmailbox_heartbeat (mrmailbox_t*);
    335 
    336 
    337 /* logging */
    338 void mrmailbox_log_error (mrmailbox_t*, int code, const char* msg, ...);
    339 void mrmailbox_log_error_if (int* condition, mrmailbox_t*, int code, const char* msg, ...);
    340 void mrmailbox_log_warning (mrmailbox_t*, int code, const char* msg, ...);
    341 void mrmailbox_log_info (mrmailbox_t*, int code, const char* msg, ...);
    342 void mrmailbox_log_vprintf (mrmailbox_t*, int event, int code, const char* msg, va_list);
    343 int mrmailbox_get_thread_index (void);
    344 
    345 
    346 /* error codes */
    347 #define MR_ERR_SELF_NOT_IN_GROUP 1
    348 #define MR_ERR_NONETWORK 2
    349 
    350 
    351 /* deprecated functions */
    352 int mrchat_set_draft (mrchat_t*, const char* msg); /* deprecated - use mrmailbox_set_draft() instead */
    353 #define mrpoortext_t mrlot_t
    354 #define mrpoortext_unref mrlot_unref
    355 
    356 
    357 /* library-internal */
    358 uint32_t mrmailbox_send_msg_object (mrmailbox_t*, uint32_t chat_id, mrmsg_t*);
    359 void mrmailbox_connect_to_imap (mrmailbox_t*, mrjob_t*);
    360 void mrmailbox_wake_lock (mrmailbox_t*);
    361 void mrmailbox_wake_unlock (mrmailbox_t*);
    362 int mrmailbox_poke_eml_file (mrmailbox_t*, const char* file);
    363 int mrmailbox_is_reply_to_known_message__ (mrmailbox_t*, mrmimeparser_t*);
    364 int mrmailbox_is_reply_to_messenger_message__ (mrmailbox_t*, mrmimeparser_t*);
    365 time_t mrmailbox_correct_bad_timestamp__ (mrmailbox_t* ths, uint32_t chat_id, uint32_t from_id, time_t desired_timestamp, int is_fresh_msg);
    366 void mrmailbox_add_or_lookup_contacts_by_mailbox_list__(mrmailbox_t* ths, struct mailimf_mailbox_list* mb_list, int origin, mrarray_t* ids, int* check_self);
    367 void mrmailbox_add_or_lookup_contacts_by_address_list__(mrmailbox_t* ths, struct mailimf_address_list* adr_list, int origin, mrarray_t* ids, int* check_self);
    368 int mrmailbox_get_archived_count__ (mrmailbox_t*);
    369 int mrmailbox_reset_tables (mrmailbox_t*, int bits); /* reset tables but leaves server configuration, 1=jobs, 2=e2ee, 8=rest but server config */
    370 size_t mrmailbox_get_real_contact_cnt__ (mrmailbox_t*);
    371 uint32_t mrmailbox_add_or_lookup_contact__ (mrmailbox_t*, const char* display_name /*can be NULL*/, const char* addr_spec, int origin, int* sth_modified);
    372 int mrmailbox_get_contact_origin__ (mrmailbox_t*, uint32_t id, int* ret_blocked);
    373 int mrmailbox_is_contact_blocked__ (mrmailbox_t*, uint32_t id);
    374 int mrmailbox_real_contact_exists__ (mrmailbox_t*, uint32_t id);
    375 int mrmailbox_contact_addr_equals__ (mrmailbox_t*, uint32_t contact_id, const char* other_addr);
    376 void mrmailbox_scaleup_contact_origin__ (mrmailbox_t*, uint32_t contact_id, int origin);
    377 void mrmailbox_unarchive_chat__ (mrmailbox_t*, uint32_t chat_id);
    378 size_t mrmailbox_get_chat_cnt__ (mrmailbox_t*);
    379 uint32_t mrmailbox_create_or_lookup_nchat_by_contact_id__ (mrmailbox_t*, uint32_t contact_id);
    380 uint32_t mrmailbox_lookup_real_nchat_by_contact_id__ (mrmailbox_t*, uint32_t contact_id);
    381 int mrmailbox_get_total_msg_count__ (mrmailbox_t*, uint32_t chat_id);
    382 int mrmailbox_get_fresh_msg_count__ (mrmailbox_t*, uint32_t chat_id);
    383 uint32_t mrmailbox_get_last_deaddrop_fresh_msg__ (mrmailbox_t*);
    384 void mrmailbox_send_msg_to_smtp (mrmailbox_t*, mrjob_t*);
    385 void mrmailbox_send_msg_to_imap (mrmailbox_t*, mrjob_t*);
    386 int mrmailbox_add_contact_to_chat__ (mrmailbox_t*, uint32_t chat_id, uint32_t contact_id);
    387 int mrmailbox_is_contact_in_chat__ (mrmailbox_t*, uint32_t chat_id, uint32_t contact_id);
    388 int mrmailbox_get_chat_contact_count__ (mrmailbox_t*, uint32_t chat_id);
    389 int mrmailbox_group_explicitly_left__ (mrmailbox_t*, const char* grpid);
    390 void mrmailbox_set_group_explicitly_left__ (mrmailbox_t*, const char* grpid);
    391 size_t mrmailbox_get_real_msg_cnt__ (mrmailbox_t*); /* the number of messages assigned to real chat (!=deaddrop, !=trash) */
    392 size_t mrmailbox_get_deaddrop_msg_cnt__ (mrmailbox_t*);
    393 int mrmailbox_rfc724_mid_cnt__ (mrmailbox_t*, const char* rfc724_mid);
    394 int mrmailbox_rfc724_mid_exists__ (mrmailbox_t*, const char* rfc724_mid, char** ret_server_folder, uint32_t* ret_server_uid);
    395 void mrmailbox_update_server_uid__ (mrmailbox_t*, const char* rfc724_mid, const char* server_folder, uint32_t server_uid);
    396 void mrmailbox_update_msg_chat_id__ (mrmailbox_t*, uint32_t msg_id, uint32_t chat_id);
    397 void mrmailbox_update_msg_state__ (mrmailbox_t*, uint32_t msg_id, int state);
    398 void mrmailbox_delete_msg_on_imap (mrmailbox_t* mailbox, mrjob_t* job);
    399 int mrmailbox_mdn_from_ext__ (mrmailbox_t*, uint32_t from_id, const char* rfc724_mid, uint32_t* ret_chat_id, uint32_t* ret_msg_id); /* returns 1 if an event should be send */
    400 void mrmailbox_send_mdn (mrmailbox_t*, mrjob_t* job);
    401 void mrmailbox_markseen_msg_on_imap (mrmailbox_t* mailbox, mrjob_t* job);
    402 void mrmailbox_markseen_mdn_on_imap (mrmailbox_t* mailbox, mrjob_t* job);
    403 
    404 
    405 /* library private: end-to-end-encryption */
    406 #define MR_E2EE_DEFAULT_ENABLED 1
    407 #define MR_MDNS_DEFAULT_ENABLED 1
    408 
    409 typedef struct mrmailbox_e2ee_helper_t {
    410  int m_encryption_successfull;
    411  void* m_cdata_to_free;
    412 } mrmailbox_e2ee_helper_t;
    413 
    414 void mrmailbox_e2ee_encrypt (mrmailbox_t*, const clist* recipients_addr, int e2ee_guaranteed, int encrypt_to_self, struct mailmime* in_out_message, mrmailbox_e2ee_helper_t*);
    415 int mrmailbox_e2ee_decrypt (mrmailbox_t*, struct mailmime* in_out_message, int* ret_validation_errors); /* returns 1 if sth. was decrypted, 0 in other cases */
    416 void mrmailbox_e2ee_thanks (mrmailbox_e2ee_helper_t*); /* frees data referenced by "mailmime" but not freed by mailmime_free(). After calling mre2ee_unhelp(), in_out_message cannot be used any longer! */
    417 int mrmailbox_ensure_secret_key_exists (mrmailbox_t*); /* makes sure, the private key exists, needed only for exporting keys and the case no message was sent before */
    418 char* mrmailbox_create_setup_code (mrmailbox_t*);
    419 int mrmailbox_render_setup_file (mrmailbox_t* mailbox, const char* passphrase, char** ret_msg);
    420 
    421 #ifdef __cplusplus
    422 } /* /extern "C" */
    423 #endif
    424 #endif /* __MRMAILBOX_H__ */
    int mrmailbox_add_address_book(mrmailbox_t *mailbox, const char *adr_book)
    Add a number of contacts.
    Definition: mrmailbox.c:4343
    +
    uint32_t mrmailbox_create_group_chat(mrmailbox_t *mailbox, const char *chat_name)
    Create a new group chat.
    Definition: mrmailbox.c:3631
    +
    uint32_t mrmailbox_create_contact(mrmailbox_t *mailbox, const char *name, const char *addr)
    Add a single contact.
    Definition: mrmailbox.c:4300
    +
    uint32_t mrmailbox_send_text_msg(mrmailbox_t *mailbox, uint32_t chat_id, const char *text_to_send)
    Send a simple text message a given chat.
    Definition: mrmailbox.c:3253
    void mrmailbox_close(mrmailbox_t *mailbox)
    Close mailbox database.
    Definition: mrmailbox.c:1083
    -
    char * mrmailbox_initiate_key_transfer(mrmailbox_t *mailbox)
    Initiate Autocrypt key transfer.
    Definition: mrmailbox_imex.c:1255
    +
    char * mrmailbox_initiate_key_transfer(mrmailbox_t *mailbox)
    Initiate Autocrypt key transfer.
    Definition: mrmailbox_imex.c:468
    mrmailbox_t * mrmailbox_new(mrmailboxcb_t cb, void *userdata, const char *os_name)
    Create a new mailbox object.
    Definition: mrmailbox.c:900
    -
    int mrmailbox_is_contact_in_chat(mrmailbox_t *mailbox, uint32_t chat_id, uint32_t contact_id)
    Check if a given contact ID is a member of a group chat.
    Definition: mrmailbox.c:3865
    +
    int mrmailbox_is_contact_in_chat(mrmailbox_t *mailbox, uint32_t chat_id, uint32_t contact_id)
    Check if a given contact ID is a member of a group chat.
    Definition: mrmailbox.c:3869
    The following constants are used as events reported to the callback given to mrmailbox_new().
    mrchat_t * mrmailbox_get_chat(mrmailbox_t *mailbox, uint32_t chat_id)
    Get chat object by a chat ID.
    Definition: mrmailbox.c:1699
    -
    int mrmailbox_remove_contact_from_chat(mrmailbox_t *mailbox, uint32_t chat_id, uint32_t contact_id)
    Remove a member from a group.
    Definition: mrmailbox.c:3982
    -
    void mrmailbox_imex_cancel(mrmailbox_t *mailbox)
    Signal the import-/export-process to stop.
    Definition: mrmailbox_imex.c:994
    +
    int mrmailbox_remove_contact_from_chat(mrmailbox_t *mailbox, uint32_t chat_id, uint32_t contact_id)
    Remove a member from a group.
    Definition: mrmailbox.c:3986
    +
    void mrmailbox_imex_cancel(mrmailbox_t *mailbox)
    Signal the import-/export-process to stop.
    Definition: mrmailbox_imex.c:1171
    int mrmailbox_open(mrmailbox_t *mailbox, const char *dbfile, const char *blobdir)
    Open mailbox database.
    Definition: mrmailbox.c:1018
    An object representing a single contact in memory.
    Definition: mrcontact.h:38
    An object containing a simple array.
    Definition: mrarray.h:39
    mrarray_t * mrmailbox_get_chat_msgs(mrmailbox_t *mailbox, uint32_t chat_id, uint32_t flags, uint32_t marker1before)
    Get all message IDs belonging to a chat.
    Definition: mrmailbox.c:2111
    -
    uint32_t mrmailbox_send_file_msg(mrmailbox_t *mailbox, uint32_t chat_id, const char *file, const char *filemime)
    Send a document to a chat.
    Definition: mrmailbox.c:3464
    -
    int mrmailbox_delete_contact(mrmailbox_t *mailbox, uint32_t contact_id)
    Delete a contact.
    Definition: mrmailbox.c:4827
    +
    uint32_t mrmailbox_send_file_msg(mrmailbox_t *mailbox, uint32_t chat_id, const char *file, const char *filemime)
    Send a document to a chat.
    Definition: mrmailbox.c:3468
    +
    int mrmailbox_delete_contact(mrmailbox_t *mailbox, uint32_t contact_id)
    Delete a contact.
    Definition: mrmailbox.c:4831
    An object representing a single chatlist in memory.
    Definition: mrchatlist.h:43
    void mrmailbox_heartbeat(mrmailbox_t *ths)
    Stay alive.
    Definition: mrmailbox.c:1623
    -
    void mrmailbox_star_msgs(mrmailbox_t *mailbox, 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: mrmailbox.c:5272
    +
    void mrmailbox_star_msgs(mrmailbox_t *mailbox, 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: mrmailbox.c:5276
    int mrmailbox_set_config(mrmailbox_t *ths, const char *key, const char *value)
    Configure the mailbox.
    Definition: mrmailbox.c:1184
    An object representing a single mailbox.
    Definition: mrmailbox.h:189
    -
    void mrmailbox_delete_msgs(mrmailbox_t *mailbox, const uint32_t *msg_ids, int msg_cnt)
    Delete messages.
    Definition: mrmailbox.c:5414
    -
    uint32_t mrmailbox_send_video_msg(mrmailbox_t *mailbox, uint32_t chat_id, const char *file, const char *filemime, int width, int height, int duration)
    Send an video to a chat.
    Definition: mrmailbox.c:3335
    +
    void mrmailbox_delete_msgs(mrmailbox_t *mailbox, const uint32_t *msg_ids, int msg_cnt)
    Delete messages.
    Definition: mrmailbox.c:5418
    +
    uint32_t mrmailbox_send_video_msg(mrmailbox_t *mailbox, uint32_t chat_id, const char *file, const char *filemime, int width, int height, int duration)
    Send an video to a chat.
    Definition: mrmailbox.c:3339
    int mrmailbox_is_open(const mrmailbox_t *mailbox)
    Check if the mailbox database is open.
    Definition: mrmailbox.c:1117
    void mrmailbox_archive_chat(mrmailbox_t *mailbox, uint32_t chat_id, int archive)
    Archive or unarchive a chat.
    Definition: mrmailbox.c:2649
    char * mrmailbox_get_info(mrmailbox_t *mailbox)
    Get information about the mailbox.
    Definition: mrmailbox.c:1285
    -
    mrarray_t * mrmailbox_get_blocked_contacts(mrmailbox_t *mailbox)
    Get blocked contacts.
    Definition: mrmailbox.c:4458
    -
    mrarray_t * mrmailbox_get_known_contacts(mrmailbox_t *mailbox, const char *query)
    Returns known and unblocked contacts.
    Definition: mrmailbox.c:4394
    -
    int mrmailbox_add_contact_to_chat(mrmailbox_t *mailbox, uint32_t chat_id, uint32_t contact_id)
    Add a member to a group.
    Definition: mrmailbox.c:3897
    +
    mrarray_t * mrmailbox_get_blocked_contacts(mrmailbox_t *mailbox)
    Get blocked contacts.
    Definition: mrmailbox.c:4462
    +
    mrarray_t * mrmailbox_get_known_contacts(mrmailbox_t *mailbox, const char *query)
    Returns known and unblocked contacts.
    Definition: mrmailbox.c:4398
    +
    int mrmailbox_add_contact_to_chat(mrmailbox_t *mailbox, uint32_t chat_id, uint32_t contact_id)
    Add a member to a group.
    Definition: mrmailbox.c:3901
    uint32_t mrmailbox_get_next_media(mrmailbox_t *mailbox, uint32_t curr_msg_id, int dir)
    Get next/previous message of the same type.
    Definition: mrmailbox.c:1918
    char * mrmailbox_get_version_str(void)
    Find out the version of the Delta Chat core library.
    Definition: mrmailbox.c:1483
    void mrmailbox_disconnect(mrmailbox_t *mailbox)
    Disonnect the mailbox from the server.
    Definition: mrmailbox.c:1598
    -
    uint32_t mrmailbox_send_voice_msg(mrmailbox_t *mailbox, uint32_t chat_id, const char *file, const char *filemime, int duration)
    Send a voice message to a chat.
    Definition: mrmailbox.c:3379
    +
    uint32_t mrmailbox_send_voice_msg(mrmailbox_t *mailbox, uint32_t chat_id, const char *file, const char *filemime, int duration)
    Send a voice message to a chat.
    Definition: mrmailbox.c:3383
    void mrmailbox_connect(mrmailbox_t *mailbox)
    Connect to the mailbox using the configured settings.
    Definition: mrmailbox.c:1571
    int mrmailbox_get_total_msg_count(mrmailbox_t *mailbox, uint32_t chat_id)
    Get the total number of messages in a chat.
    Definition: mrmailbox.c:2581
    -
    uint32_t mrmailbox_send_vcard_msg(mrmailbox_t *mailbox, uint32_t chat_id, uint32_t contact_id)
    Send foreign contact data to a chat.
    Definition: mrmailbox.c:3512
    +
    uint32_t mrmailbox_send_vcard_msg(mrmailbox_t *mailbox, uint32_t chat_id, uint32_t contact_id)
    Send foreign contact data to a chat.
    Definition: mrmailbox.c:3516
    void mrmailbox_unref(mrmailbox_t *mailbox)
    Free a mailbox object.
    Definition: mrmailbox.c:957
    -
    void mrmailbox_block_contact(mrmailbox_t *mailbox, uint32_t contact_id, int new_blocking)
    Block or unblock a contact.
    Definition: mrmailbox.c:4608
    +
    void mrmailbox_block_contact(mrmailbox_t *mailbox, uint32_t contact_id, int new_blocking)
    Block or unblock a contact.
    Definition: mrmailbox.c:4612
    +
    int mrmailbox_continue_key_transfer(mrmailbox_t *mailbox, uint32_t msg_id, const char *setup_code)
    Continue the key transfer on another device.
    Definition: mrmailbox_imex.c:539
    uintptr_t(* mrmailboxcb_t)(mrmailbox_t *, int event, uintptr_t data1, uintptr_t data2)
    Callback function that should be given to mrmailbox_new().
    Definition: mrmailbox.h:179
    int mrmailbox_configure_and_connect(mrmailbox_t *mailbox)
    Configure and connect a mailbox.
    Definition: mrmailbox_configure.c:397
    mrchatlist_t * mrmailbox_get_chatlist(mrmailbox_t *mailbox, int listflags, const char *query)
    Get a list of chats.
    Definition: mrmailbox.c:1655
    @@ -137,33 +138,33 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    int mrmailbox_get_fresh_msg_count(mrmailbox_t *mailbox, uint32_t chat_id)
    Get the number of fresh messages in a chat.
    Definition: mrmailbox.c:2609
    void mrmailbox_delete_chat(mrmailbox_t *mailbox, uint32_t chat_id)
    Delete a chat.
    Definition: mrmailbox.c:2770
    void mrmailbox_set_draft(mrmailbox_t *mailbox, uint32_t chat_id, const char *msg)
    Save a draft for a chat.
    Definition: mrmailbox.c:2364
    -
    int mrmailbox_imex(mrmailbox_t *mailbox, int what, const char *param1, const char *param2)
    Import/export things.
    Definition: mrmailbox_imex.c:894
    -
    int mrmailbox_get_blocked_count(mrmailbox_t *mailbox)
    Get the number of blocked contacts.
    Definition: mrmailbox.c:4492
    +
    int mrmailbox_imex(mrmailbox_t *mailbox, int what, const char *param1, const char *param2)
    Import/export things.
    Definition: mrmailbox_imex.c:1071
    +
    int mrmailbox_get_blocked_count(mrmailbox_t *mailbox)
    Get the number of blocked contacts.
    Definition: mrmailbox.c:4496
    mrarray_t * mrmailbox_search_msgs(mrmailbox_t *mailbox, uint32_t chat_id, const char *query)
    Search messages containing the given query string.
    Definition: mrmailbox.c:2215
    -
    uint32_t mrmailbox_send_image_msg(mrmailbox_t *mailbox, uint32_t chat_id, const char *file, const char *filemime, int width, int height)
    Send an image to a chat.
    Definition: mrmailbox.c:3290
    -
    mrmsg_t * mrmailbox_get_msg(mrmailbox_t *mailbox, uint32_t msg_id)
    Get a single message object of the type mrmsg_t.
    Definition: mrmailbox.c:5019
    +
    uint32_t mrmailbox_send_image_msg(mrmailbox_t *mailbox, uint32_t chat_id, const char *file, const char *filemime, int width, int height)
    Send an image to a chat.
    Definition: mrmailbox.c:3294
    +
    mrmsg_t * mrmailbox_get_msg(mrmailbox_t *mailbox, uint32_t msg_id)
    Get a single message object of the type mrmsg_t.
    Definition: mrmailbox.c:5023
    void * m_userdata
    Use data, may be used for any purpose.
    Definition: mrmailbox.h:191
    int mrmailbox_is_configured(mrmailbox_t *mailbox)
    Check if the mailbox is already configured.
    Definition: mrmailbox_configure.c:751
    -
    int mrmailbox_set_chat_profile_image(mrmailbox_t *mailbox, uint32_t chat_id, const char *new_image)
    Set group profile image.
    Definition: mrmailbox.c:3776
    +
    int mrmailbox_set_chat_profile_image(mrmailbox_t *mailbox, uint32_t chat_id, const char *new_image)
    Set group profile image.
    Definition: mrmailbox.c:3780
    uint32_t mrmailbox_create_chat_by_contact_id(mrmailbox_t *mailbox, uint32_t contact_id)
    Create a normal chat with a single user.
    Definition: mrmailbox.c:1806
    -
    void mrmailbox_forward_msgs(mrmailbox_t *mailbox, const uint32_t *msg_ids, int msg_cnt, uint32_t chat_id)
    Forward messages to another chat.
    Definition: mrmailbox.c:5186
    -
    void mrmailbox_markseen_msgs(mrmailbox_t *mailbox, const uint32_t *msg_ids, int msg_cnt)
    Mark a message as seen, updates the IMAP state and sends MDNs.
    Definition: mrmailbox.c:5555
    +
    void mrmailbox_forward_msgs(mrmailbox_t *mailbox, const uint32_t *msg_ids, int msg_cnt, uint32_t chat_id)
    Forward messages to another chat.
    Definition: mrmailbox.c:5190
    +
    void mrmailbox_markseen_msgs(mrmailbox_t *mailbox, const uint32_t *msg_ids, int msg_cnt)
    Mark a message as seen, updates the IMAP state and sends MDNs.
    Definition: mrmailbox.c:5559
    mrarray_t * mrmailbox_get_chat_contacts(mrmailbox_t *mailbox, uint32_t chat_id)
    Get contact IDs belonging to a chat.
    Definition: mrmailbox.c:1994
    void mrmailbox_marknoticed_chat(mrmailbox_t *mailbox, uint32_t chat_id)
    Mark all message in a chat as noticed.
    Definition: mrmailbox.c:1745
    -
    char * mrmailbox_imex_has_backup(mrmailbox_t *mailbox, const char *dir_name)
    Check if there is a backup file.
    Definition: mrmailbox_imex.c:1063
    +
    char * mrmailbox_imex_has_backup(mrmailbox_t *mailbox, const char *dir_name)
    Check if there is a backup file.
    Definition: mrmailbox_imex.c:1240
    void mrmailbox_configure_cancel(mrmailbox_t *mailbox)
    Signal the configure-process to stop.
    Definition: mrmailbox_configure.c:720
    mrarray_t * mrmailbox_get_fresh_msgs(mrmailbox_t *mailbox)
    Returns the message IDs of all fresh messages of any chat.
    Definition: mrmailbox.c:2043
    -
    mrcontact_t * mrmailbox_get_contact(mrmailbox_t *mailbox, uint32_t contact_id)
    Get a single contact object.
    Definition: mrmailbox.c:4534
    -
    int mrmailbox_check_password(mrmailbox_t *mailbox, const char *test_pw)
    Check if the user is authorized by the given password in some way.
    Definition: mrmailbox_imex.c:1129
    -
    void mrmailbox_marknoticed_contact(mrmailbox_t *mailbox, uint32_t contact_id)
    Mark all messages send by the given contact as noticed.
    Definition: mrmailbox.c:4582
    +
    mrcontact_t * mrmailbox_get_contact(mrmailbox_t *mailbox, uint32_t contact_id)
    Get a single contact object.
    Definition: mrmailbox.c:4538
    +
    int mrmailbox_check_password(mrmailbox_t *mailbox, const char *test_pw)
    Check if the user is authorized by the given password in some way.
    Definition: mrmailbox_imex.c:1306
    +
    void mrmailbox_marknoticed_contact(mrmailbox_t *mailbox, uint32_t contact_id)
    Mark all messages send by the given contact as noticed.
    Definition: mrmailbox.c:4586
    int mrmailbox_set_config_int(mrmailbox_t *ths, const char *key, int32_t value)
    Configure the mailbox.
    Definition: mrmailbox.c:1237
    int32_t mrmailbox_get_config_int(mrmailbox_t *ths, const char *key, int32_t def)
    Get a configuration option.
    Definition: mrmailbox.c:1259
    -
    int mrmailbox_set_chat_name(mrmailbox_t *mailbox, uint32_t chat_id, const char *new_name)
    Set group name.
    Definition: mrmailbox.c:3695
    -
    char * mrmailbox_get_contact_encrinfo(mrmailbox_t *mailbox, uint32_t contact_id)
    Get encryption info for a contact.
    Definition: mrmailbox.c:4699
    +
    int mrmailbox_set_chat_name(mrmailbox_t *mailbox, uint32_t chat_id, const char *new_name)
    Set group name.
    Definition: mrmailbox.c:3699
    +
    char * mrmailbox_get_contact_encrinfo(mrmailbox_t *mailbox, uint32_t contact_id)
    Get encryption info for a contact.
    Definition: mrmailbox.c:4703
    mrarray_t * mrmailbox_get_chat_media(mrmailbox_t *mailbox, uint32_t chat_id, int msg_type, int or_msg_type)
    Returns all message IDs of the given types in a chat.
    Definition: mrmailbox.c:1886
    -
    uint32_t mrmailbox_send_audio_msg(mrmailbox_t *mailbox, uint32_t chat_id, const char *file, const char *filemime, int duration, const char *author, const char *trackname)
    Send an audio file to a chat.
    Definition: mrmailbox.c:3422
    +
    uint32_t mrmailbox_send_audio_msg(mrmailbox_t *mailbox, uint32_t chat_id, const char *file, const char *filemime, int duration, const char *author, const char *trackname)
    Send an audio file to a chat.
    Definition: mrmailbox.c:3426
    char * mrmailbox_get_config(mrmailbox_t *ths, const char *key, const char *def)
    Get a configuration option.
    Definition: mrmailbox.c:1215
    -
    char * mrmailbox_get_msg_info(mrmailbox_t *mailbox, uint32_t msg_id)
    Get an informational text for a single message.
    Definition: mrmailbox.c:5061
    +
    char * mrmailbox_get_msg_info(mrmailbox_t *mailbox, uint32_t msg_id)
    Get an informational text for a single message.
    Definition: mrmailbox.c:5065
    An object representing a single chat in memory.
    Definition: mrchat.h:39
    diff --git a/docs/html/mrmimefactory_8h_source.html b/docs/html/mrmimefactory_8h_source.html index 8c21c1a0..319eefc6 100644 --- a/docs/html/mrmimefactory_8h_source.html +++ b/docs/html/mrmimefactory_8h_source.html @@ -89,7 +89,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    mrmimefactory.h
    -
    1 /*******************************************************************************
    2  *
    3  * Delta Chat Core
    4  * Copyright (C) 2017 Björn Petersen
    5  * Contact: r10s@b44t.com, http://b44t.com
    6  *
    7  * This program is free software: you can redistribute it and/or modify it under
    8  * the terms of the GNU General Public License as published by the Free Software
    9  * Foundation, either version 3 of the License, or (at your option) any later
    10  * version.
    11  *
    12  * This program is distributed in the hope that it will be useful, but WITHOUT
    13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    14  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
    15  * details.
    16  *
    17  * You should have received a copy of the GNU General Public License along with
    18  * this program. If not, see http://www.gnu.org/licenses/ .
    19  *
    20  ******************************************************************************/
    21 
    22 
    23 #ifndef __MRMIMEFACTORY_H__
    24 #define __MRMIMEFACTORY_H__
    25 #ifdef __cplusplus
    26 extern "C" {
    27 #endif
    28 
    29 
    30 
    31 
    32 typedef struct mrmsg_t mrmsg_t;
    33 typedef struct mrchat_t mrchat_t;
    34 typedef struct mrmailbox_t mrmailbox_t;
    35 
    36 
    37 #define MR_SYSTEM_GROUPNAME_CHANGED 2
    38 #define MR_SYSTEM_GROUPIMAGE_CHANGED 3
    39 #define MR_SYSTEM_MEMBER_ADDED_TO_GROUP 4
    40 #define MR_SYSTEM_MEMBER_REMOVED_FROM_GROUP 5
    41 
    42 
    43 typedef enum {
    44  MR_MF_NOTHING_LOADED = 0,
    45  MR_MF_MSG_LOADED,
    46  MR_MF_MDN_LOADED
    47 } mrmimefactory_loaded_t;
    48 
    49 
    53 typedef struct mrmimefactory_t {
    54 
    57  /* in: parameters, set eg. by mrmimefactory_load_msg() */
    58  char* m_from_addr;
    59  char* m_from_displayname;
    60  char* m_selfstatus;
    61  clist* m_recipients_names;
    62  clist* m_recipients_addr;
    63  time_t m_timestamp;
    64  char* m_rfc724_mid;
    65 
    66  /* what is loaded? */
    67  mrmimefactory_loaded_t m_loaded;
    68 
    69  mrmsg_t* m_msg;
    70  mrchat_t* m_chat;
    71  int m_increation;
    72  char* m_predecessor;
    73  char* m_references;
    74  int m_req_mdn;
    75 
    76  /* out: after a successfull mrmimefactory_create_mime(), here's the data */
    77  MMAPString* m_out;
    78  int m_out_encrypted;
    79 
    80  /* private */
    81  mrmailbox_t* m_mailbox;
    82 
    83 } mrmimefactory_t;
    84 
    85 
    86 void mrmimefactory_init (mrmimefactory_t*, mrmailbox_t*);
    87 void mrmimefactory_empty (mrmimefactory_t*);
    88 int mrmimefactory_load_msg (mrmimefactory_t*, uint32_t msg_id);
    89 int mrmimefactory_load_mdn (mrmimefactory_t*, uint32_t msg_id);
    90 int mrmimefactory_render (mrmimefactory_t*, int encrypt_to_self);
    91 
    92 
    93 #ifdef __cplusplus
    94 } /* /extern "C" */
    95 #endif
    96 #endif /* __MRMIMEFACTORY_H__ */
    97 
    An object representing a single mailbox.
    Definition: mrmailbox.h:189
    +
    1 /*******************************************************************************
    2  *
    3  * Delta Chat Core
    4  * Copyright (C) 2017 Björn Petersen
    5  * Contact: r10s@b44t.com, http://b44t.com
    6  *
    7  * This program is free software: you can redistribute it and/or modify it under
    8  * the terms of the GNU General Public License as published by the Free Software
    9  * Foundation, either version 3 of the License, or (at your option) any later
    10  * version.
    11  *
    12  * This program is distributed in the hope that it will be useful, but WITHOUT
    13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    14  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
    15  * details.
    16  *
    17  * You should have received a copy of the GNU General Public License along with
    18  * this program. If not, see http://www.gnu.org/licenses/ .
    19  *
    20  ******************************************************************************/
    21 
    22 
    23 #ifndef __MRMIMEFACTORY_H__
    24 #define __MRMIMEFACTORY_H__
    25 #ifdef __cplusplus
    26 extern "C" {
    27 #endif
    28 
    29 
    30 
    31 
    32 typedef struct mrmsg_t mrmsg_t;
    33 typedef struct mrchat_t mrchat_t;
    34 typedef struct mrmailbox_t mrmailbox_t;
    35 
    36 
    37 #define MR_SYSTEM_GROUPNAME_CHANGED 2
    38 #define MR_SYSTEM_GROUPIMAGE_CHANGED 3
    39 #define MR_SYSTEM_MEMBER_ADDED_TO_GROUP 4
    40 #define MR_SYSTEM_MEMBER_REMOVED_FROM_GROUP 5
    41 #define MR_SYSTEM_AUTOCRYPT_SETUP_MESSAGE 6
    42 
    43 
    44 typedef enum {
    45  MR_MF_NOTHING_LOADED = 0,
    46  MR_MF_MSG_LOADED,
    47  MR_MF_MDN_LOADED
    48 } mrmimefactory_loaded_t;
    49 
    50 
    54 typedef struct mrmimefactory_t {
    55 
    58  /* in: parameters, set eg. by mrmimefactory_load_msg() */
    59  char* m_from_addr;
    60  char* m_from_displayname;
    61  char* m_selfstatus;
    62  clist* m_recipients_names;
    63  clist* m_recipients_addr;
    64  time_t m_timestamp;
    65  char* m_rfc724_mid;
    66 
    67  /* what is loaded? */
    68  mrmimefactory_loaded_t m_loaded;
    69 
    70  mrmsg_t* m_msg;
    71  mrchat_t* m_chat;
    72  int m_increation;
    73  char* m_predecessor;
    74  char* m_references;
    75  int m_req_mdn;
    76 
    77  /* out: after a successfull mrmimefactory_create_mime(), here's the data */
    78  MMAPString* m_out;
    79  int m_out_encrypted;
    80 
    81  /* private */
    82  mrmailbox_t* m_mailbox;
    83 
    84 } mrmimefactory_t;
    85 
    86 
    87 void mrmimefactory_init (mrmimefactory_t*, mrmailbox_t*);
    88 void mrmimefactory_empty (mrmimefactory_t*);
    89 int mrmimefactory_load_msg (mrmimefactory_t*, uint32_t msg_id);
    90 int mrmimefactory_load_mdn (mrmimefactory_t*, uint32_t msg_id);
    91 int mrmimefactory_render (mrmimefactory_t*, int encrypt_to_self);
    92 
    93 
    94 #ifdef __cplusplus
    95 } /* /extern "C" */
    96 #endif
    97 #endif /* __MRMIMEFACTORY_H__ */
    98 
    An object representing a single mailbox.
    Definition: mrmailbox.h:189
    An object representing a single message in memory.
    Definition: mrmsg.h:40
    An object representing a single chat in memory.
    Definition: mrchat.h:39
    diff --git a/docs/html/mrmsg_8h_source.html b/docs/html/mrmsg_8h_source.html index bbd90f9d..bd0376ee 100644 --- a/docs/html/mrmsg_8h_source.html +++ b/docs/html/mrmsg_8h_source.html @@ -89,16 +89,17 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    mrmsg.h
    -
    1 /*******************************************************************************
    2  *
    3  * Delta Chat Core
    4  * Copyright (C) 2017 Björn Petersen
    5  * Contact: r10s@b44t.com, http://b44t.com
    6  *
    7  * This program is free software: you can redistribute it and/or modify it under
    8  * the terms of the GNU General Public License as published by the Free Software
    9  * Foundation, either version 3 of the License, or (at your option) any later
    10  * version.
    11  *
    12  * This program is distributed in the hope that it will be useful, but WITHOUT
    13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    14  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
    15  * details.
    16  *
    17  * You should have received a copy of the GNU General Public License along with
    18  * this program. If not, see http://www.gnu.org/licenses/ .
    19  *
    20  ******************************************************************************/
    21 
    22 
    23 #ifndef __MRMSG_H__
    24 #define __MRMSG_H__
    25 #ifdef __cplusplus
    26 extern "C" {
    27 #endif
    28 
    29 
    30 typedef struct mrmailbox_t mrmailbox_t;
    31 typedef struct mrparam_t mrparam_t;
    32 typedef struct sqlite3_stmt sqlite3_stmt;
    33 
    34 
    40 typedef struct mrmsg_t
    41 {
    45  uint32_t m_id;
    46  #define MR_MSG_ID_MARKER1 1
    47  #define MR_MSG_ID_DAYMARKER 9
    48  #define MR_MSG_ID_LAST_SPECIAL 9
    49 
    50 
    55  uint32_t m_from_id;
    56 
    57 
    62  uint32_t m_to_id;
    63 
    64 
    69  uint32_t m_chat_id;
    70 
    71 
    72  /*
    73  * The mailbox object the chat belongs to. Never NULL.
    74  */
    75  //mrmailbox_t* m_mailbox;
    76 
    77 
    80  int m_type;
    81  #define MR_MSG_UNDEFINED 0
    82  #define MR_MSG_TEXT 10
    83  #define MR_MSG_IMAGE 20 /* m_param may contain MRP_FILE, MRP_WIDTH, MRP_HEIGHT */
    84  #define MR_MSG_GIF 21 /* - " - */
    85  #define MR_MSG_AUDIO 40 /* m_param may contain MRP_FILE, MRP_DURATION */
    86  #define MR_MSG_VOICE 41 /* - " - */
    87  #define MR_MSG_VIDEO 50 /* m_param may contain MRP_FILE, MRP_WIDTH, MRP_HEIGHT, MRP_DURATION */
    88  #define MR_MSG_FILE 60 /* m_param may contain MRP_FILE */
    89 
    90  int m_state;
    91  #define MR_STATE_UNDEFINED 0
    92  #define MR_STATE_IN_FRESH 10
    93  #define MR_STATE_IN_NOTICED 13
    94  #define MR_STATE_IN_SEEN 16
    95  #define MR_STATE_OUT_PENDING 20
    96  #define MR_STATE_OUT_ERROR 24
    97  #define MR_STATE_OUT_DELIVERED 26
    98  #define MR_STATE_OUT_MDN_RCVD 28
    99 
    100  time_t m_timestamp;
    101  char* m_text;
    103  mrmailbox_t* m_mailbox;
    104  char* m_rfc724_mid;
    105  char* m_server_folder;
    106  uint32_t m_server_uid;
    107  int m_is_msgrmsg;
    108  int m_starred;
    109  mrparam_t* m_param;
    110 } mrmsg_t;
    111 
    112 
    113 mrmsg_t* mrmsg_new ();
    114 void mrmsg_unref (mrmsg_t*);
    115 void mrmsg_empty (mrmsg_t*);
    116 
    117 int mrmsg_get_type (mrmsg_t*);
    118 int mrmsg_get_state (mrmsg_t*);
    119 time_t mrmsg_get_timestamp (mrmsg_t*);
    120 char* mrmsg_get_text (mrmsg_t*);
    121 char* mrmsg_get_file (mrmsg_t*);
    122 char* mrmsg_get_filename (mrmsg_t*);
    123 char* mrmsg_get_filemime (mrmsg_t*);
    124 uint64_t mrmsg_get_filebytes (mrmsg_t*);
    126 int mrmsg_get_width (mrmsg_t*);
    131 char* mrmsg_get_summarytext (mrmsg_t*, int approx_characters);
    136 
    137 void mrmsg_latefiling_mediasize (mrmsg_t*, int width, int height, int duration);
    138 
    139 
    140 /* library-private */
    141 #define MR_MSG_FIELDS " m.id,rfc724_mid,m.server_folder,m.server_uid,m.chat_id, m.from_id,m.to_id,m.timestamp, m.type,m.state,m.msgrmsg,m.txt, m.param,m.starred "
    142 int mrmsg_set_from_stmt__ (mrmsg_t*, sqlite3_stmt* row, int row_offset); /* row order is MR_MSG_FIELDS */
    143 int mrmsg_load_from_db__ (mrmsg_t*, mrmailbox_t*, uint32_t id);
    144 int mrmsg_is_increation__ (const mrmsg_t*);
    145 char* mrmsg_get_summarytext_by_raw (int type, const char* text, mrparam_t*, int approx_bytes); /* the returned value must be free()'d */
    146 void mrmsg_save_param_to_disk__ (mrmsg_t*);
    147 void mrmsg_guess_msgtype_from_suffix (const char* pathNfilename, int* ret_msgtype, char** ret_mime);
    148 void mrmsg_get_authorNtitle_from_filename (const char* pathNfilename, char** ret_author, char** ret_title);
    149 
    150 #define MR_MSG_NEEDS_ATTACHMENT(a) ((a)==MR_MSG_IMAGE || (a)==MR_MSG_GIF || (a)==MR_MSG_AUDIO || (a)==MR_MSG_VOICE || (a)==MR_MSG_VIDEO || (a)==MR_MSG_FILE)
    151 #define MR_MSG_MAKE_FILENAME_SEARCHABLE(a) ((a)==MR_MSG_AUDIO || (a)==MR_MSG_FILE || (a)==MR_MSG_VIDEO ) /* add filename.ext (without path) to m_text? this is needed for the fulltext search. The extension is useful to get all PDF, all MP3 etc. */
    152 #define MR_MSG_MAKE_SUFFIX_SEARCHABLE(a) ((a)==MR_MSG_IMAGE || (a)==MR_MSG_GIF || (a)==MR_MSG_VOICE)
    153 
    154 #define APPROX_SUBJECT_CHARS 32 /* as we do not cut inside words, this results in about 32-42 characters.
    155  Do not use too long subjects - we add a tag after the subject which gets truncated by the clients otherwise.
    156  It should also be very clear, the subject is _not_ the whole message.
    157  The value is also used for CC:-summaries */
    158 
    159 
    160 #ifdef __cplusplus
    161 } /* /extern "C" */
    162 #endif
    163 #endif /* __MRMSG_H__ */
    An object representing a single mailbox.
    Definition: mrmailbox.h:189
    +
    1 /*******************************************************************************
    2  *
    3  * Delta Chat Core
    4  * Copyright (C) 2017 Björn Petersen
    5  * Contact: r10s@b44t.com, http://b44t.com
    6  *
    7  * This program is free software: you can redistribute it and/or modify it under
    8  * the terms of the GNU General Public License as published by the Free Software
    9  * Foundation, either version 3 of the License, or (at your option) any later
    10  * version.
    11  *
    12  * This program is distributed in the hope that it will be useful, but WITHOUT
    13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    14  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
    15  * details.
    16  *
    17  * You should have received a copy of the GNU General Public License along with
    18  * this program. If not, see http://www.gnu.org/licenses/ .
    19  *
    20  ******************************************************************************/
    21 
    22 
    23 #ifndef __MRMSG_H__
    24 #define __MRMSG_H__
    25 #ifdef __cplusplus
    26 extern "C" {
    27 #endif
    28 
    29 
    30 typedef struct mrmailbox_t mrmailbox_t;
    31 typedef struct mrparam_t mrparam_t;
    32 typedef struct sqlite3_stmt sqlite3_stmt;
    33 
    34 
    40 typedef struct mrmsg_t
    41 {
    45  uint32_t m_id;
    46  #define MR_MSG_ID_MARKER1 1
    47  #define MR_MSG_ID_DAYMARKER 9
    48  #define MR_MSG_ID_LAST_SPECIAL 9
    49 
    50 
    55  uint32_t m_from_id;
    56 
    57 
    62  uint32_t m_to_id;
    63 
    64 
    69  uint32_t m_chat_id;
    70 
    71 
    72  /*
    73  * The mailbox object the chat belongs to. Never NULL.
    74  */
    75  //mrmailbox_t* m_mailbox;
    76 
    77 
    80  int m_type;
    81  #define MR_MSG_UNDEFINED 0
    82  #define MR_MSG_TEXT 10
    83  #define MR_MSG_IMAGE 20 /* m_param may contain MRP_FILE, MRP_WIDTH, MRP_HEIGHT */
    84  #define MR_MSG_GIF 21 /* - " - */
    85  #define MR_MSG_AUDIO 40 /* m_param may contain MRP_FILE, MRP_DURATION */
    86  #define MR_MSG_VOICE 41 /* - " - */
    87  #define MR_MSG_VIDEO 50 /* m_param may contain MRP_FILE, MRP_WIDTH, MRP_HEIGHT, MRP_DURATION */
    88  #define MR_MSG_FILE 60 /* m_param may contain MRP_FILE */
    89 
    90  int m_state;
    91  #define MR_STATE_UNDEFINED 0
    92  #define MR_STATE_IN_FRESH 10
    93  #define MR_STATE_IN_NOTICED 13
    94  #define MR_STATE_IN_SEEN 16
    95  #define MR_STATE_OUT_PENDING 20
    96  #define MR_STATE_OUT_ERROR 24
    97  #define MR_STATE_OUT_DELIVERED 26
    98  #define MR_STATE_OUT_MDN_RCVD 28
    99 
    100  time_t m_timestamp;
    101  char* m_text;
    103  mrmailbox_t* m_mailbox;
    104  char* m_rfc724_mid;
    105  char* m_server_folder;
    106  uint32_t m_server_uid;
    107  int m_is_msgrmsg;
    108  int m_starred;
    109  mrparam_t* m_param;
    110 } mrmsg_t;
    111 
    112 
    113 mrmsg_t* mrmsg_new ();
    114 void mrmsg_unref (mrmsg_t*);
    115 void mrmsg_empty (mrmsg_t*);
    116 
    117 int mrmsg_get_type (mrmsg_t*);
    118 int mrmsg_get_state (mrmsg_t*);
    119 time_t mrmsg_get_timestamp (mrmsg_t*);
    120 char* mrmsg_get_text (mrmsg_t*);
    121 char* mrmsg_get_file (mrmsg_t*);
    122 char* mrmsg_get_filename (mrmsg_t*);
    123 char* mrmsg_get_filemime (mrmsg_t*);
    124 uint64_t mrmsg_get_filebytes (mrmsg_t*);
    126 int mrmsg_get_width (mrmsg_t*);
    131 char* mrmsg_get_summarytext (mrmsg_t*, int approx_characters);
    136 
    138 
    139 void mrmsg_latefiling_mediasize (mrmsg_t*, int width, int height, int duration);
    140 
    141 
    142 /* library-private */
    143 #define MR_MSG_FIELDS " m.id,rfc724_mid,m.server_folder,m.server_uid,m.chat_id, m.from_id,m.to_id,m.timestamp, m.type,m.state,m.msgrmsg,m.txt, m.param,m.starred "
    144 int mrmsg_set_from_stmt__ (mrmsg_t*, sqlite3_stmt* row, int row_offset); /* row order is MR_MSG_FIELDS */
    145 int mrmsg_load_from_db__ (mrmsg_t*, mrmailbox_t*, uint32_t id);
    146 int mrmsg_is_increation__ (const mrmsg_t*);
    147 char* mrmsg_get_summarytext_by_raw (int type, const char* text, mrparam_t*, int approx_bytes); /* the returned value must be free()'d */
    148 void mrmsg_save_param_to_disk__ (mrmsg_t*);
    149 void mrmsg_guess_msgtype_from_suffix (const char* pathNfilename, int* ret_msgtype, char** ret_mime);
    150 void mrmsg_get_authorNtitle_from_filename (const char* pathNfilename, char** ret_author, char** ret_title);
    151 
    152 #define MR_MSG_NEEDS_ATTACHMENT(a) ((a)==MR_MSG_IMAGE || (a)==MR_MSG_GIF || (a)==MR_MSG_AUDIO || (a)==MR_MSG_VOICE || (a)==MR_MSG_VIDEO || (a)==MR_MSG_FILE)
    153 #define MR_MSG_MAKE_FILENAME_SEARCHABLE(a) ((a)==MR_MSG_AUDIO || (a)==MR_MSG_FILE || (a)==MR_MSG_VIDEO ) /* add filename.ext (without path) to m_text? this is needed for the fulltext search. The extension is useful to get all PDF, all MP3 etc. */
    154 #define MR_MSG_MAKE_SUFFIX_SEARCHABLE(a) ((a)==MR_MSG_IMAGE || (a)==MR_MSG_GIF || (a)==MR_MSG_VOICE)
    155 
    156 #define APPROX_SUBJECT_CHARS 32 /* as we do not cut inside words, this results in about 32-42 characters.
    157  Do not use too long subjects - we add a tag after the subject which gets truncated by the clients otherwise.
    158  It should also be very clear, the subject is _not_ the whole message.
    159  The value is also used for CC:-summaries */
    160 
    161 
    162 #ifdef __cplusplus
    163 } /* /extern "C" */
    164 #endif
    165 #endif /* __MRMSG_H__ */
    An object representing a single mailbox.
    Definition: mrmailbox.h:189
    int mrmsg_is_systemcmd(mrmsg_t *msg)
    Check if the message is a system command.
    Definition: mrmsg.c:647
    int mrmsg_get_type(mrmsg_t *msg)
    Get the type of the message.
    Definition: mrmsg.c:124
    char * mrmsg_get_summarytext(mrmsg_t *msg, int approx_characters)
    Get a message summary as a single line of text.
    Definition: mrmsg.c:568
    uint64_t mrmsg_get_filebytes(mrmsg_t *msg)
    Get the size of the file.
    Definition: mrmsg.c:319
    uint32_t m_chat_id
    Chat ID the message belongs to.
    Definition: mrmsg.h:69
    +
    int mrmsg_is_setupmessage(mrmsg_t *msg)
    Check if the message is an Autocrypt Setup Message.
    Definition: mrmsg.c:673
    int mrmsg_get_state(mrmsg_t *msg)
    Get the state of a message.
    Definition: mrmsg.c:160
    mrlot_t * mrmsg_get_mediainfo(mrmsg_t *msg)
    Get real author and title.
    Definition: mrmsg.c:357
    An object representing a single message in memory.
    Definition: mrmsg.h:40
    -
    void mrmsg_latefiling_mediasize(mrmsg_t *msg, int width, int height, int duration)
    Late filing information to a message.
    Definition: mrmsg.c:941
    +
    void mrmsg_latefiling_mediasize(mrmsg_t *msg, int width, int height, int duration)
    Late filing information to a message.
    Definition: mrmsg.c:969
    mrlot_t * mrmsg_get_summary(mrmsg_t *msg, mrchat_t *chat)
    Get a summary for a message.
    Definition: mrmsg.c:526
    uint32_t m_to_id
    Contact ID of the recipient.
    Definition: mrmsg.h:62
    An object containing a set of values.
    Definition: mrlot.h:36
    @@ -106,7 +107,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    int mrmsg_get_duration(mrmsg_t *msg)
    Get duration of audio or video.
    Definition: mrmsg.c:465
    int mrmsg_is_starred(mrmsg_t *msg)
    Check if a message is starred.
    Definition: mrmsg.c:592
    char * mrmsg_get_file(mrmsg_t *msg)
    Find out full path, file name and extension of the file associated with a message.
    Definition: mrmsg.c:219
    -
    int mrmsg_is_increation(mrmsg_t *msg)
    Check if a message is still in creation.
    Definition: mrmsg.c:887
    +
    int mrmsg_is_increation(mrmsg_t *msg)
    Check if a message is still in creation.
    Definition: mrmsg.c:915
    void mrmsg_unref(mrmsg_t *msg)
    Free a message object.
    Definition: mrmsg.c:66
    uint32_t m_id
    Message ID.
    Definition: mrmsg.h:45
    char * mrmsg_get_filemime(mrmsg_t *msg)
    Get mime type of the file.
    Definition: mrmsg.c:278
    diff --git a/docs/html/mrstock_8h_source.html b/docs/html/mrstock_8h_source.html index 28095320..a3ca2a16 100644 --- a/docs/html/mrstock_8h_source.html +++ b/docs/html/mrstock_8h_source.html @@ -89,7 +89,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    mrstock.h
    -
    1 /*******************************************************************************
    2  *
    3  * Delta Chat Core
    4  * Copyright (C) 2017 Björn Petersen
    5  * Contact: r10s@b44t.com, http://b44t.com
    6  *
    7  * This program is free software: you can redistribute it and/or modify it under
    8  * the terms of the GNU General Public License as published by the Free Software
    9  * Foundation, either version 3 of the License, or (at your option) any later
    10  * version.
    11  *
    12  * This program is distributed in the hope that it will be useful, but WITHOUT
    13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    14  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
    15  * details.
    16  *
    17  * You should have received a copy of the GNU General Public License along with
    18  * this program. If not, see http://www.gnu.org/licenses/ .
    19  *
    20  ******************************************************************************/
    21 
    22 
    23 #ifndef __MRSTOCK_H__
    24 #define __MRSTOCK_H__
    25 #ifdef __cplusplus
    26 extern "C" {
    27 #endif
    28 
    29 
    30 #include "mrmailbox.h"
    31 #include <stdlib.h>
    32 #include <string.h>
    33 
    34 
    35 /* Strings requested by MR_EVENT_GET_STRING and MR_EVENT_GET_QUANTITY_STRING */
    36 #define MR_STR_FREE_ 0
    37 #define MR_STR_NOMESSAGES 1
    38 #define MR_STR_SELF 2
    39 #define MR_STR_DRAFT 3
    40 #define MR_STR_MEMBER 4
    41 #define MR_STR_CONTACT 6
    42 #define MR_STR_VOICEMESSAGE 7
    43 #define MR_STR_DEADDROP 8
    44 #define MR_STR_IMAGE 9
    45 #define MR_STR_VIDEO 10
    46 #define MR_STR_AUDIO 11
    47 #define MR_STR_FILE 12
    48 #define MR_STR_STATUSLINE 13
    49 #define MR_STR_NEWGROUPDRAFT 14
    50 #define MR_STR_MSGGRPNAME 15
    51 #define MR_STR_MSGGRPIMGCHANGED 16
    52 #define MR_STR_MSGADDMEMBER 17
    53 #define MR_STR_MSGDELMEMBER 18
    54 #define MR_STR_MSGGROUPLEFT 19
    55 #define MR_STR_ERROR 20
    56 #define MR_STR_SELFNOTINGRP 21
    57 #define MR_STR_NONETWORK 22
    58 #define MR_STR_GIF 23
    59 #define MR_STR_ENCRYPTEDMSG 24
    60 #define MR_STR_ENCR_E2E 25
    61 #define MR_STR_ENCR_TRANSP 27
    62 #define MR_STR_ENCR_NONE 28
    63 #define MR_STR_FINGERPRINTS 30
    64 #define MR_STR_READRCPT 31
    65 #define MR_STR_READRCPT_MAILBODY 32
    66 #define MR_STR_MSGGRPIMGDELETED 33
    67 #define MR_STR_E2E_FINE 34
    68 #define MR_STR_E2E_NO_AUTOCRYPT 35
    69 #define MR_STR_E2E_DIS_BY_YOU 36
    70 #define MR_STR_E2E_DIS_BY_RCPT 37
    71 #define MR_STR_ARCHIVEDCHATS 40
    72 #define MR_STR_STARREDMSGS 41
    73 
    74 
    75 /* should be set up by mrmailbox_new() */
    76 extern mrmailbox_t* s_localize_mb_obj;
    77 
    78 
    79 /* Return the string with the given ID by calling MR_EVENT_GET_STRING.
    80 The result must be free()'d! */
    81 char* mrstock_str (int id);
    82 
    83 
    84 /* Replaces the first `%1$s` in the given String-ID by the given value.
    85 The result must be free()'d! */
    86 char* mrstock_str_repl_string (int id, const char* value);
    87 char* mrstock_str_repl_int (int id, int value);
    88 
    89 
    90 /* Replaces the first `%1$s` and `%2$s` in the given String-ID by the two given strings.
    91 The result must be free()'d! */
    92 char* mrstock_str_repl_string2 (int id, const char*, const char*);
    93 
    94 
    95 /* Return a string with a correct plural form by callint MR_EVENT_GET_QUANTITY_STRING.
    96 The result must be free()'d! */
    97 char* mrstock_str_repl_pl (int id, int cnt);
    98 
    99 
    100 #ifdef __cplusplus
    101 } /* /extern "C" */
    102 #endif
    103 #endif /* __MRSTOCK_H__ */
    104 
    An object representing a single mailbox.
    Definition: mrmailbox.h:189
    +
    1 /*******************************************************************************
    2  *
    3  * Delta Chat Core
    4  * Copyright (C) 2017 Björn Petersen
    5  * Contact: r10s@b44t.com, http://b44t.com
    6  *
    7  * This program is free software: you can redistribute it and/or modify it under
    8  * the terms of the GNU General Public License as published by the Free Software
    9  * Foundation, either version 3 of the License, or (at your option) any later
    10  * version.
    11  *
    12  * This program is distributed in the hope that it will be useful, but WITHOUT
    13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    14  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
    15  * details.
    16  *
    17  * You should have received a copy of the GNU General Public License along with
    18  * this program. If not, see http://www.gnu.org/licenses/ .
    19  *
    20  ******************************************************************************/
    21 
    22 
    23 #ifndef __MRSTOCK_H__
    24 #define __MRSTOCK_H__
    25 #ifdef __cplusplus
    26 extern "C" {
    27 #endif
    28 
    29 
    30 #include "mrmailbox.h"
    31 #include <stdlib.h>
    32 #include <string.h>
    33 
    34 
    35 /* Strings requested by MR_EVENT_GET_STRING and MR_EVENT_GET_QUANTITY_STRING */
    36 #define MR_STR_FREE_ 0
    37 #define MR_STR_NOMESSAGES 1
    38 #define MR_STR_SELF 2
    39 #define MR_STR_DRAFT 3
    40 #define MR_STR_MEMBER 4
    41 #define MR_STR_CONTACT 6
    42 #define MR_STR_VOICEMESSAGE 7
    43 #define MR_STR_DEADDROP 8
    44 #define MR_STR_IMAGE 9
    45 #define MR_STR_VIDEO 10
    46 #define MR_STR_AUDIO 11
    47 #define MR_STR_FILE 12
    48 #define MR_STR_STATUSLINE 13
    49 #define MR_STR_NEWGROUPDRAFT 14
    50 #define MR_STR_MSGGRPNAME 15
    51 #define MR_STR_MSGGRPIMGCHANGED 16
    52 #define MR_STR_MSGADDMEMBER 17
    53 #define MR_STR_MSGDELMEMBER 18
    54 #define MR_STR_MSGGROUPLEFT 19
    55 #define MR_STR_ERROR 20
    56 #define MR_STR_SELFNOTINGRP 21
    57 #define MR_STR_NONETWORK 22
    58 #define MR_STR_GIF 23
    59 #define MR_STR_ENCRYPTEDMSG 24
    60 #define MR_STR_ENCR_E2E 25
    61 #define MR_STR_ENCR_TRANSP 27
    62 #define MR_STR_ENCR_NONE 28
    63 #define MR_STR_FINGERPRINTS 30
    64 #define MR_STR_READRCPT 31
    65 #define MR_STR_READRCPT_MAILBODY 32
    66 #define MR_STR_MSGGRPIMGDELETED 33
    67 #define MR_STR_E2E_FINE 34
    68 #define MR_STR_E2E_NO_AUTOCRYPT 35
    69 #define MR_STR_E2E_DIS_BY_YOU 36
    70 #define MR_STR_E2E_DIS_BY_RCPT 37
    71 #define MR_STR_ARCHIVEDCHATS 40
    72 #define MR_STR_STARREDMSGS 41
    73 #define MR_STR_AC_SETUP_MSG_SUBJECT 42
    74 #define MR_STR_AC_SETUP_MSG_BODY 43
    75 
    76 
    77 /* should be set up by mrmailbox_new() */
    78 extern mrmailbox_t* s_localize_mb_obj;
    79 
    80 
    81 /* Return the string with the given ID by calling MR_EVENT_GET_STRING.
    82 The result must be free()'d! */
    83 char* mrstock_str (int id);
    84 
    85 
    86 /* Replaces the first `%1$s` in the given String-ID by the given value.
    87 The result must be free()'d! */
    88 char* mrstock_str_repl_string (int id, const char* value);
    89 char* mrstock_str_repl_int (int id, int value);
    90 
    91 
    92 /* Replaces the first `%1$s` and `%2$s` in the given String-ID by the two given strings.
    93 The result must be free()'d! */
    94 char* mrstock_str_repl_string2 (int id, const char*, const char*);
    95 
    96 
    97 /* Return a string with a correct plural form by callint MR_EVENT_GET_QUANTITY_STRING.
    98 The result must be free()'d! */
    99 char* mrstock_str_repl_pl (int id, int cnt);
    100 
    101 
    102 #ifdef __cplusplus
    103 } /* /extern "C" */
    104 #endif
    105 #endif /* __MRSTOCK_H__ */
    106 
    An object representing a single mailbox.
    Definition: mrmailbox.h:189
    -
    1 /*******************************************************************************
    2  *
    3  * Delta Chat Core
    4  * Copyright (C) 2017 Björn Petersen
    5  * Contact: r10s@b44t.com, http://b44t.com
    6  *
    7  * This program is free software: you can redistribute it and/or modify it under
    8  * the terms of the GNU General Public License as published by the Free Software
    9  * Foundation, either version 3 of the License, or (at your option) any later
    10  * version.
    11  *
    12  * This program is distributed in the hope that it will be useful, but WITHOUT
    13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    14  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
    15  * details.
    16  *
    17  * You should have received a copy of the GNU General Public License along with
    18  * this program. If not, see http://www.gnu.org/licenses/ .
    19  *
    20  ******************************************************************************/
    21 
    22 
    23 /* Some tools and enhancements to the used libraries, there should be
    24 no references to mrmailbox_t and other "larger" classes here. */
    25 
    26 
    27 #ifndef __MRTOOLS_H__
    28 #define __MRTOOLS_H__
    29 #ifdef __cplusplus
    30 extern "C" {
    31 #endif
    32 
    33 
    34 /*** library-private **********************************************************/
    35 
    36 /* match tools */
    37 int mr_exactly_one_bit_set (int v);
    38 
    39 /* string tools */
    40 char* safe_strdup (const char*); /* safe_strdup() returns empty string if NULL is given, never returns NULL (exists on errors) */
    41 char* strdup_keep_null (const char*); /* strdup(NULL) is undefined, safe_strdup_keep_null(NULL) returns NULL in this case */
    42 int atoi_null_is_0 (const char*);
    43 void mr_ltrim (char*);
    44 void mr_rtrim (char*);
    45 void mr_trim (char*);
    46 char* mr_strlower (const char*); /* the result must be free()'d */
    47 void mr_strlower_in_place (char*);
    48 int mr_str_replace (char** haystack, const char* needle, const char* replacement); /* haystack may be realloc()'d, returns the number of replacements */
    49 char* mr_null_terminate (const char*, int bytes); /* the result must be free()'d */
    50 char* mr_mprintf (const char* format, ...); /* The result must be free()'d. */
    51 void mr_remove_cr_chars (char*); /* remove all \r characters from string */
    52 void mr_replace_bad_utf8_chars (char*); /* replace bad UTF-8 characters by sequences of `_` (to avoid problems in filenames, we do not use eg. `?`) the function is useful if strings are unexpectingly encoded eg. as ISO-8859-1 */
    53 void mr_truncate_n_unwrap_str (char*, int approx_characters, int do_unwrap);
    54 carray* mr_split_into_lines (const char* buf_terminated); /* split string into lines*/
    55 void mr_free_splitted_lines (carray* lines);
    56 char* mr_insert_breaks (const char*, int break_every, const char* break_chars); /* insert a break every n characters, the return must be free()'d */
    57 char* mr_arr_to_string (const uint32_t*, int cnt);
    58 char* mr_decode_header_string (const char*); /* the result must be free()'d */
    59 char* mr_encode_header_string (const char*); /* the result must be free()'d */
    60 char* imap_modified_utf7_to_utf8 (const char *mbox, int change_spaces);
    61 char* imap_utf8_to_modified_utf7 (const char *src, int change_spaces);
    62 char* mr_url_encode (const char*); /* the result must be free()'d */
    63 char* encode_base64 (const char * in, int len); /* prototype, from libetpan/src/data-types/base64.h which cannot be included without adding libetpan/src/... to the include-search-paths, which would result in double-file-name-errors */
    64 
    65 /* string builder */
    66 typedef struct mrstrbuilder_t
    67 {
    68  char* m_buf;
    69  int m_allocated;
    70  int m_free;
    71  char* m_eos;
    72 } mrstrbuilder_t;
    73 void mrstrbuilder_init (mrstrbuilder_t* ths);
    74 char* mrstrbuilder_cat (mrstrbuilder_t* ths, const char* text);
    75 void mrstrbuilder_empty(mrstrbuilder_t* ths); /* set the string to a lenght of 0, does not free the buffer */
    76 
    77 
    78 /* clist tools */
    79 void clist_free_content (const clist*); /* calls free() for each item content */
    80 int clist_search_string_nocase (const clist*, const char* str);
    81 
    82 /* date/time tools */
    83 #define MR_INVALID_TIMESTAMP (-1)
    84 time_t mr_timestamp_from_date (struct mailimf_date_time * date_time); /* the result is UTC or MR_INVALID_TIMESTAMP */
    85 char* mr_timestamp_to_str (time_t); /* the return value must be free()'d */
    86 struct mailimap_date_time* mr_timestamp_to_mailimap_date_time (time_t);
    87 long mr_gm2local_offset (void);
    88 
    89 /* timesmearing */
    90 time_t mr_smeared_time__ (void);
    91 time_t mr_create_smeared_timestamp__ (void);
    92 time_t mr_create_smeared_timestamps__(int count);
    93 
    94 /* Message-ID tools */
    95 #define MR_VALID_ID_LEN 11
    96 char* mr_create_id (void);
    97 char* mr_create_dummy_references_mid (void);
    98 char* mr_create_incoming_rfc724_mid (time_t message_timestamp, uint32_t contact_id_from, mrarray_t* contact_ids_to);
    99 char* mr_create_outgoing_rfc724_mid (const char* grpid, const char* addr);
    100 char* mr_extract_grpid_from_rfc724_mid (const char* rfc724_mid);
    101 char* mr_extract_grpid_from_rfc724_mid_list(const clist* rfc724_mid_list);
    102 
    103 
    104 /* file tools */
    105 int mr_file_exist (const char* pathNfilename);
    106 uint64_t mr_get_filebytes (const char* pathNfilename);
    107 char* mr_get_filename (const char* pathNfilename); /* the return value must be free()'d */
    108 int mr_delete_file (const char* pathNFilename, mrmailbox_t* log);
    109 int mr_copy_file (const char* src_pathNFilename, const char* dest_pathNFilename, mrmailbox_t* log);
    110 int mr_create_folder (const char* pathNfilename, mrmailbox_t* log);
    111 int mr_write_file (const char* pathNfilename, const void* buf, size_t buf_bytes, mrmailbox_t* log);
    112 int mr_read_file (const char* pathNfilename, void** buf, size_t* buf_bytes, mrmailbox_t* log);
    113 char* mr_get_filesuffix_lc (const char* pathNfilename); /* the returned suffix is lower-case */
    114 void mr_split_filename (const char* pathNfilename, char** ret_basename, char** ret_all_suffixes_incl_dot); /* the case of the suffix is preserved! */
    115 int mr_get_filemeta (const void* buf, size_t buf_bytes, uint32_t* ret_width, uint32_t *ret_height);
    116 char* mr_get_fine_pathNfilename (const char* folder, const char* desired_name);
    117 
    118 /* macros */
    119 #define MR_QUOTEHELPER(name) #name
    120 #define MR_STRINGIFY(macro) MR_QUOTEHELPER(macro)
    121 #define MR_MIN(X, Y) (((X) < (Y))? (X) : (Y))
    122 #define MR_MAX(X, Y) (((X) > (Y))? (X) : (Y))
    123 
    124 
    125 #ifdef __cplusplus
    126 } /* /extern "C" */
    127 #endif
    128 #endif /* __MRTOOLS_H__ */
    An object containing a simple array.
    Definition: mrarray.h:39
    +
    1 /*******************************************************************************
    2  *
    3  * Delta Chat Core
    4  * Copyright (C) 2017 Björn Petersen
    5  * Contact: r10s@b44t.com, http://b44t.com
    6  *
    7  * This program is free software: you can redistribute it and/or modify it under
    8  * the terms of the GNU General Public License as published by the Free Software
    9  * Foundation, either version 3 of the License, or (at your option) any later
    10  * version.
    11  *
    12  * This program is distributed in the hope that it will be useful, but WITHOUT
    13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    14  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
    15  * details.
    16  *
    17  * You should have received a copy of the GNU General Public License along with
    18  * this program. If not, see http://www.gnu.org/licenses/ .
    19  *
    20  ******************************************************************************/
    21 
    22 
    23 /* Some tools and enhancements to the used libraries, there should be
    24 no references to mrmailbox_t and other "larger" classes here. */
    25 
    26 
    27 #ifndef __MRTOOLS_H__
    28 #define __MRTOOLS_H__
    29 #ifdef __cplusplus
    30 extern "C" {
    31 #endif
    32 
    33 
    34 /*** library-private **********************************************************/
    35 
    36 /* match tools */
    37 int mr_exactly_one_bit_set (int v);
    38 
    39 /* string tools */
    40 char* safe_strdup (const char*); /* safe_strdup() returns empty string if NULL is given, never returns NULL (exists on errors) */
    41 char* strdup_keep_null (const char*); /* strdup(NULL) is undefined, safe_strdup_keep_null(NULL) returns NULL in this case */
    42 int atoi_null_is_0 (const char*);
    43 void mr_ltrim (char*);
    44 void mr_rtrim (char*);
    45 void mr_trim (char*);
    46 char* mr_strlower (const char*); /* the result must be free()'d */
    47 void mr_strlower_in_place (char*);
    48 int mr_str_replace (char** haystack, const char* needle, const char* replacement);
    49 char* mr_null_terminate (const char*, int bytes); /* the result must be free()'d */
    50 char* mr_mprintf (const char* format, ...); /* The result must be free()'d. */
    51 void mr_remove_cr_chars (char*); /* remove all \r characters from string */
    52 void mr_replace_bad_utf8_chars (char*); /* replace bad UTF-8 characters by sequences of `_` (to avoid problems in filenames, we do not use eg. `?`) the function is useful if strings are unexpectingly encoded eg. as ISO-8859-1 */
    53 void mr_truncate_n_unwrap_str (char*, int approx_characters, int do_unwrap);
    54 carray* mr_split_into_lines (const char* buf_terminated); /* split string into lines*/
    55 void mr_free_splitted_lines (carray* lines);
    56 char* mr_insert_breaks (const char*, int break_every, const char* break_chars); /* insert a break every n characters, the return must be free()'d */
    57 char* mr_arr_to_string (const uint32_t*, int cnt);
    58 char* mr_decode_header_string (const char*); /* the result must be free()'d */
    59 char* mr_encode_header_string (const char*); /* the result must be free()'d */
    60 char* imap_modified_utf7_to_utf8 (const char *mbox, int change_spaces);
    61 char* imap_utf8_to_modified_utf7 (const char *src, int change_spaces);
    62 char* mr_url_encode (const char*); /* the result must be free()'d */
    63 char* encode_base64 (const char * in, int len); /* prototype, from libetpan/src/data-types/base64.h which cannot be included without adding libetpan/src/... to the include-search-paths, which would result in double-file-name-errors */
    64 
    65 /* string builder */
    66 typedef struct mrstrbuilder_t
    67 {
    68  char* m_buf;
    69  int m_allocated;
    70  int m_free;
    71  char* m_eos;
    72 } mrstrbuilder_t;
    73 void mrstrbuilder_init (mrstrbuilder_t* ths);
    74 char* mrstrbuilder_cat (mrstrbuilder_t* ths, const char* text);
    75 void mrstrbuilder_empty(mrstrbuilder_t* ths); /* set the string to a lenght of 0, does not free the buffer */
    76 
    77 
    78 /* clist tools */
    79 void clist_free_content (const clist*); /* calls free() for each item content */
    80 int clist_search_string_nocase (const clist*, const char* str);
    81 
    82 /* date/time tools */
    83 #define MR_INVALID_TIMESTAMP (-1)
    84 time_t mr_timestamp_from_date (struct mailimf_date_time * date_time); /* the result is UTC or MR_INVALID_TIMESTAMP */
    85 char* mr_timestamp_to_str (time_t); /* the return value must be free()'d */
    86 struct mailimap_date_time* mr_timestamp_to_mailimap_date_time (time_t);
    87 long mr_gm2local_offset (void);
    88 
    89 /* timesmearing */
    90 time_t mr_smeared_time__ (void);
    91 time_t mr_create_smeared_timestamp__ (void);
    92 time_t mr_create_smeared_timestamps__(int count);
    93 
    94 /* Message-ID tools */
    95 #define MR_VALID_ID_LEN 11
    96 char* mr_create_id (void);
    97 char* mr_create_dummy_references_mid (void);
    98 char* mr_create_incoming_rfc724_mid (time_t message_timestamp, uint32_t contact_id_from, mrarray_t* contact_ids_to);
    99 char* mr_create_outgoing_rfc724_mid (const char* grpid, const char* addr);
    100 char* mr_extract_grpid_from_rfc724_mid (const char* rfc724_mid);
    101 char* mr_extract_grpid_from_rfc724_mid_list(const clist* rfc724_mid_list);
    102 
    103 
    104 /* file tools */
    105 int mr_file_exist (const char* pathNfilename);
    106 uint64_t mr_get_filebytes (const char* pathNfilename);
    107 char* mr_get_filename (const char* pathNfilename); /* the return value must be free()'d */
    108 int mr_delete_file (const char* pathNFilename, mrmailbox_t* log);
    109 int mr_copy_file (const char* src_pathNFilename, const char* dest_pathNFilename, mrmailbox_t* log);
    110 int mr_create_folder (const char* pathNfilename, mrmailbox_t* log);
    111 int mr_write_file (const char* pathNfilename, const void* buf, size_t buf_bytes, mrmailbox_t* log);
    112 int mr_read_file (const char* pathNfilename, void** buf, size_t* buf_bytes, mrmailbox_t* log);
    113 char* mr_get_filesuffix_lc (const char* pathNfilename); /* the returned suffix is lower-case */
    114 void mr_split_filename (const char* pathNfilename, char** ret_basename, char** ret_all_suffixes_incl_dot); /* the case of the suffix is preserved! */
    115 int mr_get_filemeta (const void* buf, size_t buf_bytes, uint32_t* ret_width, uint32_t *ret_height);
    116 char* mr_get_fine_pathNfilename (const char* folder, const char* desired_name);
    117 
    118 /* macros */
    119 #define MR_QUOTEHELPER(name) #name
    120 #define MR_STRINGIFY(macro) MR_QUOTEHELPER(macro)
    121 #define MR_MIN(X, Y) (((X) < (Y))? (X) : (Y))
    122 #define MR_MAX(X, Y) (((X) > (Y))? (X) : (Y))
    123 
    124 
    125 #ifdef __cplusplus
    126 } /* /extern "C" */
    127 #endif
    128 #endif /* __MRTOOLS_H__ */
    An object containing a simple array.
    Definition: mrarray.h:39
    An object representing a single mailbox.
    Definition: mrmailbox.h:189
    diff --git a/docs/html/search/all_1.js b/docs/html/search/all_1.js index 1ac05df0..3639fd94 100644 --- a/docs/html/search/all_1.js +++ b/docs/html/search/all_1.js @@ -65,6 +65,7 @@ var searchData= ['mrmailbox_5fconfigure_5fand_5fconnect',['mrmailbox_configure_and_connect',['../structmrmailbox__t.html#a42ca741cc08785585f1dc74d515be5ef',1,'mrmailbox_t']]], ['mrmailbox_5fconfigure_5fcancel',['mrmailbox_configure_cancel',['../structmrmailbox__t.html#a8127c0e3f4cfda14fdfd7be9f43715ef',1,'mrmailbox_t']]], ['mrmailbox_5fconnect',['mrmailbox_connect',['../structmrmailbox__t.html#a67eef5ffc3369b8ad09326471b0a266f',1,'mrmailbox_t']]], + ['mrmailbox_5fcontinue_5fkey_5ftransfer',['mrmailbox_continue_key_transfer',['../structmrmailbox__t.html#a13fde8828b56c0fe94227d0b105c5708',1,'mrmailbox_t']]], ['mrmailbox_5fcreate_5fchat_5fby_5fcontact_5fid',['mrmailbox_create_chat_by_contact_id',['../structmrmailbox__t.html#a1386ec2c091b936b65b25b50a302173d',1,'mrmailbox_t']]], ['mrmailbox_5fcreate_5fcontact',['mrmailbox_create_contact',['../structmrmailbox__t.html#aa089e97e7ca1add16c10d5cc0e902824',1,'mrmailbox_t']]], ['mrmailbox_5fcreate_5fgroup_5fchat',['mrmailbox_create_group_chat',['../structmrmailbox__t.html#a47156db87107ec208d6637f460d897a8',1,'mrmailbox_t']]], @@ -142,6 +143,7 @@ var searchData= ['mrmsg_5fget_5fwidth',['mrmsg_get_width',['../structmrmsg__t.html#adfe10086430b562b8df4e45668b51927',1,'mrmsg_t']]], ['mrmsg_5fis_5fforwarded',['mrmsg_is_forwarded',['../structmrmsg__t.html#a3256ed8c6a55a6c1a30e0fce33b85421',1,'mrmsg_t']]], ['mrmsg_5fis_5fincreation',['mrmsg_is_increation',['../structmrmsg__t.html#a32d23bac4bf35ed5f8c2cfbb93d636f5',1,'mrmsg_t']]], + ['mrmsg_5fis_5fsetupmessage',['mrmsg_is_setupmessage',['../structmrmsg__t.html#ab669ae58ca580d2694c6df3c95ddb89a',1,'mrmsg_t']]], ['mrmsg_5fis_5fstarred',['mrmsg_is_starred',['../structmrmsg__t.html#af202a7e7527df4681cd3ea24f779848f',1,'mrmsg_t']]], ['mrmsg_5fis_5fsystemcmd',['mrmsg_is_systemcmd',['../structmrmsg__t.html#a752209192e3a022d087fe6c647fb3ad9',1,'mrmsg_t']]], ['mrmsg_5flatefiling_5fmediasize',['mrmsg_latefiling_mediasize',['../structmrmsg__t.html#a9e5dc81d4e814284b465ad23abbfb6cb',1,'mrmsg_t']]], diff --git a/docs/html/search/functions_0.js b/docs/html/search/functions_0.js index ae0bd02b..b6c0f51e 100644 --- a/docs/html/search/functions_0.js +++ b/docs/html/search/functions_0.js @@ -32,6 +32,7 @@ var searchData= ['mrmailbox_5fconfigure_5fand_5fconnect',['mrmailbox_configure_and_connect',['../structmrmailbox__t.html#a42ca741cc08785585f1dc74d515be5ef',1,'mrmailbox_t']]], ['mrmailbox_5fconfigure_5fcancel',['mrmailbox_configure_cancel',['../structmrmailbox__t.html#a8127c0e3f4cfda14fdfd7be9f43715ef',1,'mrmailbox_t']]], ['mrmailbox_5fconnect',['mrmailbox_connect',['../structmrmailbox__t.html#a67eef5ffc3369b8ad09326471b0a266f',1,'mrmailbox_t']]], + ['mrmailbox_5fcontinue_5fkey_5ftransfer',['mrmailbox_continue_key_transfer',['../structmrmailbox__t.html#a13fde8828b56c0fe94227d0b105c5708',1,'mrmailbox_t']]], ['mrmailbox_5fcreate_5fchat_5fby_5fcontact_5fid',['mrmailbox_create_chat_by_contact_id',['../structmrmailbox__t.html#a1386ec2c091b936b65b25b50a302173d',1,'mrmailbox_t']]], ['mrmailbox_5fcreate_5fcontact',['mrmailbox_create_contact',['../structmrmailbox__t.html#aa089e97e7ca1add16c10d5cc0e902824',1,'mrmailbox_t']]], ['mrmailbox_5fcreate_5fgroup_5fchat',['mrmailbox_create_group_chat',['../structmrmailbox__t.html#a47156db87107ec208d6637f460d897a8',1,'mrmailbox_t']]], @@ -107,6 +108,7 @@ var searchData= ['mrmsg_5fget_5fwidth',['mrmsg_get_width',['../structmrmsg__t.html#adfe10086430b562b8df4e45668b51927',1,'mrmsg_t']]], ['mrmsg_5fis_5fforwarded',['mrmsg_is_forwarded',['../structmrmsg__t.html#a3256ed8c6a55a6c1a30e0fce33b85421',1,'mrmsg_t']]], ['mrmsg_5fis_5fincreation',['mrmsg_is_increation',['../structmrmsg__t.html#a32d23bac4bf35ed5f8c2cfbb93d636f5',1,'mrmsg_t']]], + ['mrmsg_5fis_5fsetupmessage',['mrmsg_is_setupmessage',['../structmrmsg__t.html#ab669ae58ca580d2694c6df3c95ddb89a',1,'mrmsg_t']]], ['mrmsg_5fis_5fstarred',['mrmsg_is_starred',['../structmrmsg__t.html#af202a7e7527df4681cd3ea24f779848f',1,'mrmsg_t']]], ['mrmsg_5fis_5fsystemcmd',['mrmsg_is_systemcmd',['../structmrmsg__t.html#a752209192e3a022d087fe6c647fb3ad9',1,'mrmsg_t']]], ['mrmsg_5flatefiling_5fmediasize',['mrmsg_latefiling_mediasize',['../structmrmsg__t.html#a9e5dc81d4e814284b465ad23abbfb6cb',1,'mrmsg_t']]], diff --git a/docs/html/structmrmailbox__t-members.html b/docs/html/structmrmailbox__t-members.html index 347aa4ae..398c228f 100644 --- a/docs/html/structmrmailbox__t-members.html +++ b/docs/html/structmrmailbox__t-members.html @@ -98,65 +98,66 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); mrmailbox_configure_and_connect(mrmailbox_t *mailbox)mrmailbox_t mrmailbox_configure_cancel(mrmailbox_t *mailbox)mrmailbox_t mrmailbox_connect(mrmailbox_t *mailbox)mrmailbox_t - mrmailbox_create_chat_by_contact_id(mrmailbox_t *mailbox, uint32_t contact_id)mrmailbox_t - mrmailbox_create_contact(mrmailbox_t *mailbox, const char *name, const char *addr)mrmailbox_t - mrmailbox_create_group_chat(mrmailbox_t *mailbox, const char *chat_name)mrmailbox_t - mrmailbox_delete_chat(mrmailbox_t *mailbox, uint32_t chat_id)mrmailbox_t - mrmailbox_delete_contact(mrmailbox_t *mailbox, uint32_t contact_id)mrmailbox_t - mrmailbox_delete_msgs(mrmailbox_t *mailbox, const uint32_t *msg_ids, int msg_cnt)mrmailbox_t - mrmailbox_disconnect(mrmailbox_t *mailbox)mrmailbox_t - mrmailbox_forward_msgs(mrmailbox_t *mailbox, const uint32_t *msg_ids, int msg_cnt, uint32_t chat_id)mrmailbox_t - mrmailbox_get_blocked_contacts(mrmailbox_t *mailbox)mrmailbox_t - mrmailbox_get_blocked_count(mrmailbox_t *mailbox)mrmailbox_t - mrmailbox_get_chat(mrmailbox_t *mailbox, uint32_t chat_id)mrmailbox_t - mrmailbox_get_chat_contacts(mrmailbox_t *mailbox, uint32_t chat_id)mrmailbox_t - mrmailbox_get_chat_id_by_contact_id(mrmailbox_t *mailbox, uint32_t contact_id)mrmailbox_t - mrmailbox_get_chat_media(mrmailbox_t *mailbox, uint32_t chat_id, int msg_type, int or_msg_type)mrmailbox_t - mrmailbox_get_chat_msgs(mrmailbox_t *mailbox, uint32_t chat_id, uint32_t flags, uint32_t marker1before)mrmailbox_t - mrmailbox_get_chatlist(mrmailbox_t *mailbox, int listflags, const char *query)mrmailbox_t - mrmailbox_get_config(mrmailbox_t *ths, const char *key, const char *def)mrmailbox_t - mrmailbox_get_config_int(mrmailbox_t *ths, const char *key, int32_t def)mrmailbox_t - mrmailbox_get_contact(mrmailbox_t *mailbox, uint32_t contact_id)mrmailbox_t - mrmailbox_get_contact_encrinfo(mrmailbox_t *mailbox, uint32_t contact_id)mrmailbox_t - mrmailbox_get_fresh_msg_count(mrmailbox_t *mailbox, uint32_t chat_id)mrmailbox_t - mrmailbox_get_fresh_msgs(mrmailbox_t *mailbox)mrmailbox_t - mrmailbox_get_info(mrmailbox_t *mailbox)mrmailbox_t - mrmailbox_get_known_contacts(mrmailbox_t *mailbox, const char *query)mrmailbox_t - mrmailbox_get_msg(mrmailbox_t *mailbox, uint32_t msg_id)mrmailbox_t - mrmailbox_get_msg_info(mrmailbox_t *mailbox, uint32_t msg_id)mrmailbox_t - mrmailbox_get_next_media(mrmailbox_t *mailbox, uint32_t curr_msg_id, int dir)mrmailbox_t - mrmailbox_get_total_msg_count(mrmailbox_t *mailbox, uint32_t chat_id)mrmailbox_t - mrmailbox_get_version_str(void)mrmailbox_t - mrmailbox_heartbeat(mrmailbox_t *ths)mrmailbox_t - mrmailbox_imex(mrmailbox_t *mailbox, int what, const char *param1, const char *param2)mrmailbox_t - mrmailbox_imex_cancel(mrmailbox_t *mailbox)mrmailbox_t - mrmailbox_imex_has_backup(mrmailbox_t *mailbox, const char *dir_name)mrmailbox_t - mrmailbox_initiate_key_transfer(mrmailbox_t *mailbox)mrmailbox_t - mrmailbox_is_configured(mrmailbox_t *mailbox)mrmailbox_t - mrmailbox_is_contact_in_chat(mrmailbox_t *mailbox, uint32_t chat_id, uint32_t contact_id)mrmailbox_t - mrmailbox_is_open(const mrmailbox_t *mailbox)mrmailbox_t - mrmailbox_marknoticed_chat(mrmailbox_t *mailbox, uint32_t chat_id)mrmailbox_t - mrmailbox_marknoticed_contact(mrmailbox_t *mailbox, uint32_t contact_id)mrmailbox_t - mrmailbox_markseen_msgs(mrmailbox_t *mailbox, const uint32_t *msg_ids, int msg_cnt)mrmailbox_t - mrmailbox_new(mrmailboxcb_t cb, void *userdata, const char *os_name)mrmailbox_t - mrmailbox_open(mrmailbox_t *mailbox, const char *dbfile, const char *blobdir)mrmailbox_t - mrmailbox_remove_contact_from_chat(mrmailbox_t *mailbox, uint32_t chat_id, uint32_t contact_id)mrmailbox_t - mrmailbox_search_msgs(mrmailbox_t *mailbox, uint32_t chat_id, const char *query)mrmailbox_t - mrmailbox_send_audio_msg(mrmailbox_t *mailbox, uint32_t chat_id, const char *file, const char *filemime, int duration, const char *author, const char *trackname)mrmailbox_t - mrmailbox_send_file_msg(mrmailbox_t *mailbox, uint32_t chat_id, const char *file, const char *filemime)mrmailbox_t - mrmailbox_send_image_msg(mrmailbox_t *mailbox, uint32_t chat_id, const char *file, const char *filemime, int width, int height)mrmailbox_t - mrmailbox_send_text_msg(mrmailbox_t *mailbox, uint32_t chat_id, const char *text_to_send)mrmailbox_t - mrmailbox_send_vcard_msg(mrmailbox_t *mailbox, uint32_t chat_id, uint32_t contact_id)mrmailbox_t - mrmailbox_send_video_msg(mrmailbox_t *mailbox, uint32_t chat_id, const char *file, const char *filemime, int width, int height, int duration)mrmailbox_t - mrmailbox_send_voice_msg(mrmailbox_t *mailbox, uint32_t chat_id, const char *file, const char *filemime, int duration)mrmailbox_t - mrmailbox_set_chat_name(mrmailbox_t *mailbox, uint32_t chat_id, const char *new_name)mrmailbox_t - mrmailbox_set_chat_profile_image(mrmailbox_t *mailbox, uint32_t chat_id, const char *new_image)mrmailbox_t - mrmailbox_set_config(mrmailbox_t *ths, const char *key, const char *value)mrmailbox_t - mrmailbox_set_config_int(mrmailbox_t *ths, const char *key, int32_t value)mrmailbox_t - mrmailbox_set_draft(mrmailbox_t *mailbox, uint32_t chat_id, const char *msg)mrmailbox_t - mrmailbox_star_msgs(mrmailbox_t *mailbox, const uint32_t *msg_ids, int msg_cnt, int star)mrmailbox_t - mrmailbox_unref(mrmailbox_t *mailbox)mrmailbox_t - mrmailboxcb_t typedefmrmailbox_t + mrmailbox_continue_key_transfer(mrmailbox_t *mailbox, uint32_t msg_id, const char *setup_code)mrmailbox_t + mrmailbox_create_chat_by_contact_id(mrmailbox_t *mailbox, uint32_t contact_id)mrmailbox_t + mrmailbox_create_contact(mrmailbox_t *mailbox, const char *name, const char *addr)mrmailbox_t + mrmailbox_create_group_chat(mrmailbox_t *mailbox, const char *chat_name)mrmailbox_t + mrmailbox_delete_chat(mrmailbox_t *mailbox, uint32_t chat_id)mrmailbox_t + mrmailbox_delete_contact(mrmailbox_t *mailbox, uint32_t contact_id)mrmailbox_t + mrmailbox_delete_msgs(mrmailbox_t *mailbox, const uint32_t *msg_ids, int msg_cnt)mrmailbox_t + mrmailbox_disconnect(mrmailbox_t *mailbox)mrmailbox_t + mrmailbox_forward_msgs(mrmailbox_t *mailbox, const uint32_t *msg_ids, int msg_cnt, uint32_t chat_id)mrmailbox_t + mrmailbox_get_blocked_contacts(mrmailbox_t *mailbox)mrmailbox_t + mrmailbox_get_blocked_count(mrmailbox_t *mailbox)mrmailbox_t + mrmailbox_get_chat(mrmailbox_t *mailbox, uint32_t chat_id)mrmailbox_t + mrmailbox_get_chat_contacts(mrmailbox_t *mailbox, uint32_t chat_id)mrmailbox_t + mrmailbox_get_chat_id_by_contact_id(mrmailbox_t *mailbox, uint32_t contact_id)mrmailbox_t + mrmailbox_get_chat_media(mrmailbox_t *mailbox, uint32_t chat_id, int msg_type, int or_msg_type)mrmailbox_t + mrmailbox_get_chat_msgs(mrmailbox_t *mailbox, uint32_t chat_id, uint32_t flags, uint32_t marker1before)mrmailbox_t + mrmailbox_get_chatlist(mrmailbox_t *mailbox, int listflags, const char *query)mrmailbox_t + mrmailbox_get_config(mrmailbox_t *ths, const char *key, const char *def)mrmailbox_t + mrmailbox_get_config_int(mrmailbox_t *ths, const char *key, int32_t def)mrmailbox_t + mrmailbox_get_contact(mrmailbox_t *mailbox, uint32_t contact_id)mrmailbox_t + mrmailbox_get_contact_encrinfo(mrmailbox_t *mailbox, uint32_t contact_id)mrmailbox_t + mrmailbox_get_fresh_msg_count(mrmailbox_t *mailbox, uint32_t chat_id)mrmailbox_t + mrmailbox_get_fresh_msgs(mrmailbox_t *mailbox)mrmailbox_t + mrmailbox_get_info(mrmailbox_t *mailbox)mrmailbox_t + mrmailbox_get_known_contacts(mrmailbox_t *mailbox, const char *query)mrmailbox_t + mrmailbox_get_msg(mrmailbox_t *mailbox, uint32_t msg_id)mrmailbox_t + mrmailbox_get_msg_info(mrmailbox_t *mailbox, uint32_t msg_id)mrmailbox_t + mrmailbox_get_next_media(mrmailbox_t *mailbox, uint32_t curr_msg_id, int dir)mrmailbox_t + mrmailbox_get_total_msg_count(mrmailbox_t *mailbox, uint32_t chat_id)mrmailbox_t + mrmailbox_get_version_str(void)mrmailbox_t + mrmailbox_heartbeat(mrmailbox_t *ths)mrmailbox_t + mrmailbox_imex(mrmailbox_t *mailbox, int what, const char *param1, const char *param2)mrmailbox_t + mrmailbox_imex_cancel(mrmailbox_t *mailbox)mrmailbox_t + mrmailbox_imex_has_backup(mrmailbox_t *mailbox, const char *dir_name)mrmailbox_t + mrmailbox_initiate_key_transfer(mrmailbox_t *mailbox)mrmailbox_t + mrmailbox_is_configured(mrmailbox_t *mailbox)mrmailbox_t + mrmailbox_is_contact_in_chat(mrmailbox_t *mailbox, uint32_t chat_id, uint32_t contact_id)mrmailbox_t + mrmailbox_is_open(const mrmailbox_t *mailbox)mrmailbox_t + mrmailbox_marknoticed_chat(mrmailbox_t *mailbox, uint32_t chat_id)mrmailbox_t + mrmailbox_marknoticed_contact(mrmailbox_t *mailbox, uint32_t contact_id)mrmailbox_t + mrmailbox_markseen_msgs(mrmailbox_t *mailbox, const uint32_t *msg_ids, int msg_cnt)mrmailbox_t + mrmailbox_new(mrmailboxcb_t cb, void *userdata, const char *os_name)mrmailbox_t + mrmailbox_open(mrmailbox_t *mailbox, const char *dbfile, const char *blobdir)mrmailbox_t + mrmailbox_remove_contact_from_chat(mrmailbox_t *mailbox, uint32_t chat_id, uint32_t contact_id)mrmailbox_t + mrmailbox_search_msgs(mrmailbox_t *mailbox, uint32_t chat_id, const char *query)mrmailbox_t + mrmailbox_send_audio_msg(mrmailbox_t *mailbox, uint32_t chat_id, const char *file, const char *filemime, int duration, const char *author, const char *trackname)mrmailbox_t + mrmailbox_send_file_msg(mrmailbox_t *mailbox, uint32_t chat_id, const char *file, const char *filemime)mrmailbox_t + mrmailbox_send_image_msg(mrmailbox_t *mailbox, uint32_t chat_id, const char *file, const char *filemime, int width, int height)mrmailbox_t + mrmailbox_send_text_msg(mrmailbox_t *mailbox, uint32_t chat_id, const char *text_to_send)mrmailbox_t + mrmailbox_send_vcard_msg(mrmailbox_t *mailbox, uint32_t chat_id, uint32_t contact_id)mrmailbox_t + mrmailbox_send_video_msg(mrmailbox_t *mailbox, uint32_t chat_id, const char *file, const char *filemime, int width, int height, int duration)mrmailbox_t + mrmailbox_send_voice_msg(mrmailbox_t *mailbox, uint32_t chat_id, const char *file, const char *filemime, int duration)mrmailbox_t + mrmailbox_set_chat_name(mrmailbox_t *mailbox, uint32_t chat_id, const char *new_name)mrmailbox_t + mrmailbox_set_chat_profile_image(mrmailbox_t *mailbox, uint32_t chat_id, const char *new_image)mrmailbox_t + mrmailbox_set_config(mrmailbox_t *ths, const char *key, const char *value)mrmailbox_t + mrmailbox_set_config_int(mrmailbox_t *ths, const char *key, int32_t value)mrmailbox_t + mrmailbox_set_draft(mrmailbox_t *mailbox, uint32_t chat_id, const char *msg)mrmailbox_t + mrmailbox_star_msgs(mrmailbox_t *mailbox, const uint32_t *msg_ids, int msg_cnt, int star)mrmailbox_t + mrmailbox_unref(mrmailbox_t *mailbox)mrmailbox_t + mrmailboxcb_t typedefmrmailbox_t