diff --git a/docs/html/functions.html b/docs/html/functions.html index 5e8287d7..1d3e0a51 100644 --- a/docs/html/functions.html +++ b/docs/html/functions.html @@ -477,12 +477,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • mrmsg_is_systemcmd() : mrmsg_t
  • +
  • mrmsg_latefiling_mediasize() +: mrmailbox_t +
  • mrmsg_new() : mrmsg_t
  • -
  • mrmsg_save_param_to_disk() -: mrmsg_t -
  • mrmsg_set_file() : mrmsg_t
  • diff --git a/docs/html/functions_func.html b/docs/html/functions_func.html index 3b80c714..cf1dc500 100644 --- a/docs/html/functions_func.html +++ b/docs/html/functions_func.html @@ -394,12 +394,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • mrmsg_is_systemcmd() : mrmsg_t
  • +
  • mrmsg_latefiling_mediasize() +: mrmailbox_t +
  • mrmsg_new() : mrmsg_t
  • -
  • mrmsg_save_param_to_disk() -: mrmsg_t -
  • mrmsg_set_file() : mrmsg_t
  • diff --git a/docs/html/mrmailbox_8h_source.html b/docs/html/mrmailbox_8h_source.html index 9fa1df02..07ac126c 100644 --- a/docs/html/mrmailbox_8h_source.html +++ b/docs/html/mrmailbox_8h_source.html @@ -89,78 +89,78 @@ 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 9
    32 #define MR_VERSION_REVISION 10
    33 
    34 
    140 #include <pthread.h>
    141 #include <libetpan/libetpan.h> /* defines uint16_t */
    142 #include "mrarray.h"
    143 #include "mrchatlist.h"
    144 #include "mrchat.h"
    145 #include "mrmsg.h"
    146 #include "mrcontact.h"
    147 #include "mrpoortext.h"
    148 #include "mrparam.h"
    149 #include "mrevent.h"
    150 
    151 typedef struct mrmailbox_t mrmailbox_t;
    152 typedef struct mrimap_t mrimap_t;
    153 typedef struct mrsmtp_t mrsmtp_t;
    154 typedef struct mrsqlite3_t mrsqlite3_t;
    155 typedef struct mrjob_t mrjob_t;
    156 typedef struct mrmimeparser_t mrmimeparser_t;
    157 
    158 
    174 typedef uintptr_t (*mrmailboxcb_t) (mrmailbox_t*, int event, uintptr_t data1, uintptr_t data2);
    175 
    176 
    184 typedef struct mrmailbox_t
    185 {
    186  void* m_userdata;
    187  char* m_dbfile;
    188  char* m_blobdir;
    191  mrsqlite3_t* m_sql;
    192  mrimap_t* m_imap;
    193  mrsmtp_t* m_smtp;
    195  pthread_t m_job_thread;
    196  pthread_cond_t m_job_cond;
    197  pthread_mutex_t m_job_condmutex;
    198  int m_job_condflag;
    199  int m_job_do_exit;
    201  mrmailboxcb_t m_cb;
    203  char* m_os_name;
    205  uint32_t m_cmdline_sel_chat_id;
    207  int m_wake_lock;
    208  pthread_mutex_t m_wake_lock_critical;
    210  int m_e2ee_enabled;
    212  #define MR_LOG_RINGBUF_SIZE 200
    213  pthread_mutex_t m_log_ringbuf_critical;
    214  char* m_log_ringbuf[MR_LOG_RINGBUF_SIZE];
    216  time_t m_log_ringbuf_times[MR_LOG_RINGBUF_SIZE];
    218  int m_log_ringbuf_pos;
    220 } mrmailbox_t;
    221 
    222 
    223 /* create/open/connect */
    224 mrmailbox_t* mrmailbox_new (mrmailboxcb_t, void* userdata, const char* os_name);
    225 void mrmailbox_unref (mrmailbox_t*);
    226 
    227 int mrmailbox_open (mrmailbox_t*, const char* dbfile, const char* blobdir);
    228 void mrmailbox_close (mrmailbox_t*);
    229 int mrmailbox_is_open (const mrmailbox_t*);
    230 
    231 int mrmailbox_set_config (mrmailbox_t*, const char* key, const char* value);
    232 char* mrmailbox_get_config (mrmailbox_t*, const char* key, const char* def);
    233 int mrmailbox_set_config_int (mrmailbox_t*, const char* key, int32_t value);
    234 int32_t mrmailbox_get_config_int (mrmailbox_t*, const char* key, int32_t def);
    235 char* mrmailbox_get_version_str (void);
    236 
    237 int mrmailbox_configure_and_connect(mrmailbox_t*);
    238 void mrmailbox_configure_cancel (mrmailbox_t*);
    239 int mrmailbox_is_configured (mrmailbox_t*);
    240 
    241 void mrmailbox_connect (mrmailbox_t*);
    242 void mrmailbox_disconnect (mrmailbox_t*);
    243 
    244 char* mrmailbox_get_info (mrmailbox_t*);
    245 
    246 
    247 /* Handle chatlists */
    248 #define MR_GCL_ARCHIVED_ONLY 0x01
    249 #define MR_GCL_NO_SPECIALS 0x02
    250 mrchatlist_t* mrmailbox_get_chatlist (mrmailbox_t*, int flags, const char* query);
    251 
    252 
    253 /* Handle chats */
    254 uint32_t mrmailbox_create_chat_by_contact_id (mrmailbox_t*, uint32_t contact_id);
    255 uint32_t mrmailbox_get_chat_id_by_contact_id (mrmailbox_t*, uint32_t contact_id);
    256 
    257 uint32_t mrmailbox_send_text_msg (mrmailbox_t*, uint32_t chat_id, const char* text_to_send);
    258 uint32_t mrmailbox_send_msg (mrmailbox_t*, uint32_t chat_id, mrmsg_t*);
    259 uint32_t mrmailbox_send_vcard_msg (mrmailbox_t*, uint32_t chat_id, uint32_t contact_id);
    260 void mrmailbox_set_draft (mrmailbox_t*, uint32_t chat_id, const char*);
    261 
    262 #define MR_GCM_ADDDAYMARKER 0x01
    263 mrarray_t* mrmailbox_get_chat_msgs (mrmailbox_t*, uint32_t chat_id, uint32_t flags, uint32_t marker1before);
    264 int mrmailbox_get_total_msg_count (mrmailbox_t*, uint32_t chat_id);
    265 int mrmailbox_get_fresh_msg_count (mrmailbox_t*, uint32_t chat_id);
    266 mrarray_t* mrmailbox_get_fresh_msgs (mrmailbox_t*);
    267 void mrmailbox_marknoticed_chat (mrmailbox_t*, uint32_t chat_id);
    268 mrarray_t* mrmailbox_get_chat_media (mrmailbox_t*, uint32_t chat_id, int msg_type, int or_msg_type);
    269 uint32_t mrmailbox_get_next_media (mrmailbox_t*, uint32_t curr_msg_id, int dir);
    270 
    271 void mrmailbox_archive_chat (mrmailbox_t*, uint32_t chat_id, int archive);
    272 void mrmailbox_delete_chat (mrmailbox_t*, uint32_t chat_id);
    273 
    274 mrarray_t* mrmailbox_get_chat_contacts (mrmailbox_t*, uint32_t chat_id);
    275 mrarray_t* mrmailbox_search_msgs (mrmailbox_t*, uint32_t chat_id, const char* query);
    276 
    277 mrchat_t* mrmailbox_get_chat (mrmailbox_t*, uint32_t chat_id);
    278 
    279 
    280 /* Handle group chats */
    281 uint32_t mrmailbox_create_group_chat (mrmailbox_t*, const char* name);
    282 int mrmailbox_is_contact_in_chat (mrmailbox_t*, uint32_t chat_id, uint32_t contact_id);
    283 int mrmailbox_add_contact_to_chat (mrmailbox_t*, uint32_t chat_id, uint32_t contact_id);
    284 int mrmailbox_remove_contact_from_chat (mrmailbox_t*, uint32_t chat_id, uint32_t contact_id);
    285 int mrmailbox_set_chat_name (mrmailbox_t*, uint32_t chat_id, const char* name);
    286 int mrmailbox_set_chat_profile_image (mrmailbox_t*, uint32_t chat_id, const char* image);
    287 
    288 
    289 /* Handle messages */
    290 char* mrmailbox_get_msg_info (mrmailbox_t*, uint32_t msg_id);
    291 void mrmailbox_delete_msgs (mrmailbox_t*, const uint32_t* msg_ids, int msg_cnt);
    292 void mrmailbox_forward_msgs (mrmailbox_t*, const uint32_t* msg_ids, int msg_cnt, uint32_t chat_id);
    293 void mrmailbox_marknoticed_contact (mrmailbox_t*, uint32_t contact_id);
    294 void mrmailbox_markseen_msgs (mrmailbox_t*, const uint32_t* msg_ids, int msg_cnt);
    295 void mrmailbox_star_msgs (mrmailbox_t*, const uint32_t* msg_ids, int msg_cnt, int star);
    296 mrmsg_t* mrmailbox_get_msg (mrmailbox_t*, uint32_t msg_id);
    297 
    298 
    299 /* Handle contacts */
    300 uint32_t mrmailbox_create_contact (mrmailbox_t*, const char* name, const char* addr);
    301 int mrmailbox_add_address_book (mrmailbox_t*, const char*);
    302 mrarray_t* mrmailbox_get_known_contacts (mrmailbox_t*, const char* query);
    303 int mrmailbox_get_blocked_count (mrmailbox_t*);
    305 void mrmailbox_block_contact (mrmailbox_t*, uint32_t contact_id, int block);
    306 char* mrmailbox_get_contact_encrinfo (mrmailbox_t*, uint32_t contact_id);
    307 int mrmailbox_delete_contact (mrmailbox_t*, uint32_t contact_id);
    308 mrcontact_t* mrmailbox_get_contact (mrmailbox_t*, uint32_t contact_id);
    309 
    310 
    311 /* Import/export and Tools */
    312 #define MR_IMEX_CANCEL 0
    313 #define MR_IMEX_EXPORT_SELF_KEYS 1 /* param1 is a directory where the keys are written to */
    314 #define MR_IMEX_IMPORT_SELF_KEYS 2 /* param1 is a directory where the keys are searched in and read from */
    315 #define MR_IMEX_EXPORT_BACKUP 11 /* param1 is a directory where the backup is written to */
    316 #define MR_IMEX_IMPORT_BACKUP 12 /* param1 is the file with the backup to import */
    317 #define MR_IMEX_EXPORT_SETUP_MESSAGE 20 /* param1 is a directory where the setup file is written to */
    318 #define MR_BAK_PREFIX "delta-chat"
    319 #define MR_BAK_SUFFIX "bak"
    320 void mrmailbox_imex (mrmailbox_t*, int what, const char* param1, const char* setup_code);
    321 char* mrmailbox_imex_has_backup (mrmailbox_t*, const char* dir);
    322 int mrmailbox_check_password (mrmailbox_t*, const char* pw);
    323 char* mrmailbox_create_setup_code (mrmailbox_t*);
    324 void mrmailbox_heartbeat (mrmailbox_t*);
    325 
    326 
    327 /* logging */
    328 void mrmailbox_log_error (mrmailbox_t*, int code, const char* msg, ...);
    329 void mrmailbox_log_error_if (int* condition, mrmailbox_t*, int code, const char* msg, ...);
    330 void mrmailbox_log_warning (mrmailbox_t*, int code, const char* msg, ...);
    331 void mrmailbox_log_info (mrmailbox_t*, int code, const char* msg, ...);
    332 void mrmailbox_log_vprintf (mrmailbox_t*, int event, int code, const char* msg, va_list);
    333 int mrmailbox_get_thread_index (void);
    334 
    335 
    336 /* error codes */
    337 #define MR_ERR_SELF_NOT_IN_GROUP 1
    338 #define MR_ERR_NONETWORK 2
    339 
    340 
    341 /* deprecated functions */
    342 int mrchat_set_draft (mrchat_t*, const char* msg); /* deprecated - use mrmailbox_set_draft() instead */
    343 
    344 
    345 /* library-internal */
    346 uint32_t mrmailbox_send_msg_i__ (mrmailbox_t*, mrchat_t*, const mrmsg_t*, time_t);
    347 void mrmailbox_connect_to_imap (mrmailbox_t*, mrjob_t*);
    348 void mrmailbox_wake_lock (mrmailbox_t*);
    349 void mrmailbox_wake_unlock (mrmailbox_t*);
    350 int mrmailbox_poke_eml_file (mrmailbox_t*, const char* file);
    351 int mrmailbox_is_reply_to_known_message__ (mrmailbox_t*, mrmimeparser_t*);
    352 int mrmailbox_is_reply_to_messenger_message__ (mrmailbox_t*, mrmimeparser_t*);
    353 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);
    354 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);
    355 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);
    356 int mrmailbox_get_archived_count__ (mrmailbox_t*);
    357 int mrmailbox_reset_tables (mrmailbox_t*, int bits); /* reset tables but leaves server configuration, 1=jobs, 2=e2ee, 8=rest but server config */
    358 size_t mrmailbox_get_real_contact_cnt__ (mrmailbox_t*);
    359 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);
    360 int mrmailbox_get_contact_origin__ (mrmailbox_t*, uint32_t id, int* ret_blocked);
    361 int mrmailbox_is_contact_blocked__ (mrmailbox_t*, uint32_t id);
    362 int mrmailbox_real_contact_exists__ (mrmailbox_t*, uint32_t id);
    363 int mrmailbox_contact_addr_equals__ (mrmailbox_t*, uint32_t contact_id, const char* other_addr);
    364 void mrmailbox_scaleup_contact_origin__ (mrmailbox_t*, uint32_t contact_id, int origin);
    365 void mrmailbox_unarchive_chat__ (mrmailbox_t*, uint32_t chat_id);
    366 size_t mrmailbox_get_chat_cnt__ (mrmailbox_t*);
    367 uint32_t mrmailbox_create_or_lookup_nchat_by_contact_id__ (mrmailbox_t*, uint32_t contact_id);
    368 uint32_t mrmailbox_lookup_real_nchat_by_contact_id__ (mrmailbox_t*, uint32_t contact_id);
    369 int mrmailbox_get_total_msg_count__ (mrmailbox_t*, uint32_t chat_id);
    370 int mrmailbox_get_fresh_msg_count__ (mrmailbox_t*, uint32_t chat_id);
    371 uint32_t mrmailbox_get_last_deaddrop_fresh_msg__ (mrmailbox_t*);
    372 void mrmailbox_send_msg_to_smtp (mrmailbox_t*, mrjob_t*);
    373 void mrmailbox_send_msg_to_imap (mrmailbox_t*, mrjob_t*);
    374 int mrmailbox_add_contact_to_chat__ (mrmailbox_t*, uint32_t chat_id, uint32_t contact_id);
    375 int mrmailbox_is_contact_in_chat__ (mrmailbox_t*, uint32_t chat_id, uint32_t contact_id);
    376 int mrmailbox_get_chat_contact_count__ (mrmailbox_t*, uint32_t chat_id);
    377 int mrmailbox_group_explicitly_left__ (mrmailbox_t*, const char* grpid);
    378 void mrmailbox_set_group_explicitly_left__ (mrmailbox_t*, const char* grpid);
    379 size_t mrmailbox_get_real_msg_cnt__ (mrmailbox_t*); /* the number of messages assigned to real chat (!=deaddrop, !=trash) */
    380 size_t mrmailbox_get_deaddrop_msg_cnt__ (mrmailbox_t*);
    381 int mrmailbox_rfc724_mid_cnt__ (mrmailbox_t*, const char* rfc724_mid);
    382 int mrmailbox_rfc724_mid_exists__ (mrmailbox_t*, const char* rfc724_mid, char** ret_server_folder, uint32_t* ret_server_uid);
    383 void mrmailbox_update_server_uid__ (mrmailbox_t*, const char* rfc724_mid, const char* server_folder, uint32_t server_uid);
    384 void mrmailbox_update_msg_chat_id__ (mrmailbox_t*, uint32_t msg_id, uint32_t chat_id);
    385 void mrmailbox_update_msg_state__ (mrmailbox_t*, uint32_t msg_id, int state);
    386 void mrmailbox_delete_msg_on_imap (mrmailbox_t* mailbox, mrjob_t* job);
    387 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 */
    388 void mrmailbox_send_mdn (mrmailbox_t*, mrjob_t* job);
    389 void mrmailbox_markseen_msg_on_imap (mrmailbox_t* mailbox, mrjob_t* job);
    390 void mrmailbox_markseen_mdn_on_imap (mrmailbox_t* mailbox, mrjob_t* job);
    391 
    392 
    393 /* library private: end-to-end-encryption */
    394 #define MR_E2EE_DEFAULT_ENABLED 1
    395 #define MR_MDNS_DEFAULT_ENABLED 1
    396 
    397 typedef struct mrmailbox_e2ee_helper_t {
    398  int m_encryption_successfull;
    399  void* m_cdata_to_free;
    400 } mrmailbox_e2ee_helper_t;
    401 
    402 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*);
    403 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 */
    404 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! */
    405 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 */
    406 
    407 
    408 #ifdef __cplusplus
    409 } /* /extern "C" */
    410 #endif
    411 #endif /* __MRMAILBOX_H__ */
    int mrmailbox_add_address_book(mrmailbox_t *mailbox, const char *adr_book)
    Add a number of contacts.
    Definition: mrmailbox.c:4115
    -
    uint32_t mrmailbox_create_group_chat(mrmailbox_t *mailbox, const char *chat_name)
    Create a new group chat.
    Definition: mrmailbox.c:3407
    -
    uint32_t mrmailbox_create_contact(mrmailbox_t *mailbox, const char *name, const char *addr)
    Add a single contact.
    Definition: mrmailbox.c:4075
    -
    uint32_t mrmailbox_send_text_msg(mrmailbox_t *mailbox, uint32_t chat_id, const char *text_to_send)
    Send a simple text message to the given chat.
    Definition: mrmailbox.c:3097
    +
    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 9
    32 #define MR_VERSION_REVISION 10
    33 
    34 
    140 #include <pthread.h>
    141 #include <libetpan/libetpan.h> /* defines uint16_t */
    142 #include "mrarray.h"
    143 #include "mrchatlist.h"
    144 #include "mrchat.h"
    145 #include "mrmsg.h"
    146 #include "mrcontact.h"
    147 #include "mrpoortext.h"
    148 #include "mrparam.h"
    149 #include "mrevent.h"
    150 
    151 typedef struct mrmailbox_t mrmailbox_t;
    152 typedef struct mrimap_t mrimap_t;
    153 typedef struct mrsmtp_t mrsmtp_t;
    154 typedef struct mrsqlite3_t mrsqlite3_t;
    155 typedef struct mrjob_t mrjob_t;
    156 typedef struct mrmimeparser_t mrmimeparser_t;
    157 
    158 
    174 typedef uintptr_t (*mrmailboxcb_t) (mrmailbox_t*, int event, uintptr_t data1, uintptr_t data2);
    175 
    176 
    184 typedef struct mrmailbox_t
    185 {
    186  void* m_userdata;
    187  char* m_dbfile;
    188  char* m_blobdir;
    191  mrsqlite3_t* m_sql;
    192  mrimap_t* m_imap;
    193  mrsmtp_t* m_smtp;
    195  pthread_t m_job_thread;
    196  pthread_cond_t m_job_cond;
    197  pthread_mutex_t m_job_condmutex;
    198  int m_job_condflag;
    199  int m_job_do_exit;
    201  mrmailboxcb_t m_cb;
    203  char* m_os_name;
    205  uint32_t m_cmdline_sel_chat_id;
    207  int m_wake_lock;
    208  pthread_mutex_t m_wake_lock_critical;
    210  int m_e2ee_enabled;
    212  #define MR_LOG_RINGBUF_SIZE 200
    213  pthread_mutex_t m_log_ringbuf_critical;
    214  char* m_log_ringbuf[MR_LOG_RINGBUF_SIZE];
    216  time_t m_log_ringbuf_times[MR_LOG_RINGBUF_SIZE];
    218  int m_log_ringbuf_pos;
    220 } mrmailbox_t;
    221 
    222 
    223 /* create/open/connect */
    224 mrmailbox_t* mrmailbox_new (mrmailboxcb_t, void* userdata, const char* os_name);
    225 void mrmailbox_unref (mrmailbox_t*);
    226 
    227 int mrmailbox_open (mrmailbox_t*, const char* dbfile, const char* blobdir);
    228 void mrmailbox_close (mrmailbox_t*);
    229 int mrmailbox_is_open (const mrmailbox_t*);
    230 
    231 int mrmailbox_set_config (mrmailbox_t*, const char* key, const char* value);
    232 char* mrmailbox_get_config (mrmailbox_t*, const char* key, const char* def);
    233 int mrmailbox_set_config_int (mrmailbox_t*, const char* key, int32_t value);
    234 int32_t mrmailbox_get_config_int (mrmailbox_t*, const char* key, int32_t def);
    235 char* mrmailbox_get_version_str (void);
    236 
    237 int mrmailbox_configure_and_connect(mrmailbox_t*);
    238 void mrmailbox_configure_cancel (mrmailbox_t*);
    239 int mrmailbox_is_configured (mrmailbox_t*);
    240 
    241 void mrmailbox_connect (mrmailbox_t*);
    242 void mrmailbox_disconnect (mrmailbox_t*);
    243 
    244 char* mrmailbox_get_info (mrmailbox_t*);
    245 
    246 
    247 /* Handle chatlists */
    248 #define MR_GCL_ARCHIVED_ONLY 0x01
    249 #define MR_GCL_NO_SPECIALS 0x02
    250 mrchatlist_t* mrmailbox_get_chatlist (mrmailbox_t*, int flags, const char* query);
    251 
    252 
    253 /* Handle chats */
    254 uint32_t mrmailbox_create_chat_by_contact_id (mrmailbox_t*, uint32_t contact_id);
    255 uint32_t mrmailbox_get_chat_id_by_contact_id (mrmailbox_t*, uint32_t contact_id);
    256 
    257 uint32_t mrmailbox_send_text_msg (mrmailbox_t*, uint32_t chat_id, const char* text_to_send);
    258 uint32_t mrmailbox_send_msg (mrmailbox_t*, uint32_t chat_id, mrmsg_t*);
    259 uint32_t mrmailbox_send_vcard_msg (mrmailbox_t*, uint32_t chat_id, uint32_t contact_id);
    260 void mrmailbox_set_draft (mrmailbox_t*, uint32_t chat_id, const char*);
    261 
    262 #define MR_GCM_ADDDAYMARKER 0x01
    263 mrarray_t* mrmailbox_get_chat_msgs (mrmailbox_t*, uint32_t chat_id, uint32_t flags, uint32_t marker1before);
    264 int mrmailbox_get_total_msg_count (mrmailbox_t*, uint32_t chat_id);
    265 int mrmailbox_get_fresh_msg_count (mrmailbox_t*, uint32_t chat_id);
    266 mrarray_t* mrmailbox_get_fresh_msgs (mrmailbox_t*);
    267 void mrmailbox_marknoticed_chat (mrmailbox_t*, uint32_t chat_id);
    268 mrarray_t* mrmailbox_get_chat_media (mrmailbox_t*, uint32_t chat_id, int msg_type, int or_msg_type);
    269 uint32_t mrmailbox_get_next_media (mrmailbox_t*, uint32_t curr_msg_id, int dir);
    270 
    271 void mrmailbox_archive_chat (mrmailbox_t*, uint32_t chat_id, int archive);
    272 void mrmailbox_delete_chat (mrmailbox_t*, uint32_t chat_id);
    273 
    274 mrarray_t* mrmailbox_get_chat_contacts (mrmailbox_t*, uint32_t chat_id);
    275 mrarray_t* mrmailbox_search_msgs (mrmailbox_t*, uint32_t chat_id, const char* query);
    276 
    277 mrchat_t* mrmailbox_get_chat (mrmailbox_t*, uint32_t chat_id);
    278 
    279 
    280 /* Handle group chats */
    281 uint32_t mrmailbox_create_group_chat (mrmailbox_t*, const char* name);
    282 int mrmailbox_is_contact_in_chat (mrmailbox_t*, uint32_t chat_id, uint32_t contact_id);
    283 int mrmailbox_add_contact_to_chat (mrmailbox_t*, uint32_t chat_id, uint32_t contact_id);
    284 int mrmailbox_remove_contact_from_chat (mrmailbox_t*, uint32_t chat_id, uint32_t contact_id);
    285 int mrmailbox_set_chat_name (mrmailbox_t*, uint32_t chat_id, const char* name);
    286 int mrmailbox_set_chat_profile_image (mrmailbox_t*, uint32_t chat_id, const char* image);
    287 
    288 
    289 /* Handle messages */
    290 char* mrmailbox_get_msg_info (mrmailbox_t*, uint32_t msg_id);
    291 void mrmailbox_delete_msgs (mrmailbox_t*, const uint32_t* msg_ids, int msg_cnt);
    292 void mrmailbox_forward_msgs (mrmailbox_t*, const uint32_t* msg_ids, int msg_cnt, uint32_t chat_id);
    293 void mrmailbox_marknoticed_contact (mrmailbox_t*, uint32_t contact_id);
    294 void mrmailbox_markseen_msgs (mrmailbox_t*, const uint32_t* msg_ids, int msg_cnt);
    295 void mrmailbox_star_msgs (mrmailbox_t*, const uint32_t* msg_ids, int msg_cnt, int star);
    296 mrmsg_t* mrmailbox_get_msg (mrmailbox_t*, uint32_t msg_id);
    297 
    298 
    299 /* Handle contacts */
    300 uint32_t mrmailbox_create_contact (mrmailbox_t*, const char* name, const char* addr);
    301 int mrmailbox_add_address_book (mrmailbox_t*, const char*);
    302 mrarray_t* mrmailbox_get_known_contacts (mrmailbox_t*, const char* query);
    303 int mrmailbox_get_blocked_count (mrmailbox_t*);
    305 void mrmailbox_block_contact (mrmailbox_t*, uint32_t contact_id, int block);
    306 char* mrmailbox_get_contact_encrinfo (mrmailbox_t*, uint32_t contact_id);
    307 int mrmailbox_delete_contact (mrmailbox_t*, uint32_t contact_id);
    308 mrcontact_t* mrmailbox_get_contact (mrmailbox_t*, uint32_t contact_id);
    309 
    310 
    311 /* Import/export and Tools */
    312 #define MR_IMEX_CANCEL 0
    313 #define MR_IMEX_EXPORT_SELF_KEYS 1 /* param1 is a directory where the keys are written to */
    314 #define MR_IMEX_IMPORT_SELF_KEYS 2 /* param1 is a directory where the keys are searched in and read from */
    315 #define MR_IMEX_EXPORT_BACKUP 11 /* param1 is a directory where the backup is written to */
    316 #define MR_IMEX_IMPORT_BACKUP 12 /* param1 is the file with the backup to import */
    317 #define MR_IMEX_EXPORT_SETUP_MESSAGE 20 /* param1 is a directory where the setup file is written to */
    318 #define MR_BAK_PREFIX "delta-chat"
    319 #define MR_BAK_SUFFIX "bak"
    320 void mrmailbox_imex (mrmailbox_t*, int what, const char* param1, const char* setup_code);
    321 char* mrmailbox_imex_has_backup (mrmailbox_t*, const char* dir);
    322 int mrmailbox_check_password (mrmailbox_t*, const char* pw);
    323 char* mrmailbox_create_setup_code (mrmailbox_t*);
    324 void mrmailbox_heartbeat (mrmailbox_t*);
    325 
    326 
    327 /* logging */
    328 void mrmailbox_log_error (mrmailbox_t*, int code, const char* msg, ...);
    329 void mrmailbox_log_error_if (int* condition, mrmailbox_t*, int code, const char* msg, ...);
    330 void mrmailbox_log_warning (mrmailbox_t*, int code, const char* msg, ...);
    331 void mrmailbox_log_info (mrmailbox_t*, int code, const char* msg, ...);
    332 void mrmailbox_log_vprintf (mrmailbox_t*, int event, int code, const char* msg, va_list);
    333 int mrmailbox_get_thread_index (void);
    334 
    335 
    336 /* error codes */
    337 #define MR_ERR_SELF_NOT_IN_GROUP 1
    338 #define MR_ERR_NONETWORK 2
    339 
    340 
    341 /* deprecated functions */
    342 int mrchat_set_draft (mrchat_t*, const char* msg); /* deprecated - use mrmailbox_set_draft() instead */
    343 
    344 
    345 /* library-internal */
    346 uint32_t mrmailbox_send_msg_i__ (mrmailbox_t*, mrchat_t*, const mrmsg_t*, time_t);
    347 void mrmailbox_connect_to_imap (mrmailbox_t*, mrjob_t*);
    348 void mrmailbox_wake_lock (mrmailbox_t*);
    349 void mrmailbox_wake_unlock (mrmailbox_t*);
    350 int mrmailbox_poke_eml_file (mrmailbox_t*, const char* file);
    351 int mrmailbox_is_reply_to_known_message__ (mrmailbox_t*, mrmimeparser_t*);
    352 int mrmailbox_is_reply_to_messenger_message__ (mrmailbox_t*, mrmimeparser_t*);
    353 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);
    354 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);
    355 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);
    356 int mrmailbox_get_archived_count__ (mrmailbox_t*);
    357 int mrmailbox_reset_tables (mrmailbox_t*, int bits); /* reset tables but leaves server configuration, 1=jobs, 2=e2ee, 8=rest but server config */
    358 size_t mrmailbox_get_real_contact_cnt__ (mrmailbox_t*);
    359 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);
    360 int mrmailbox_get_contact_origin__ (mrmailbox_t*, uint32_t id, int* ret_blocked);
    361 int mrmailbox_is_contact_blocked__ (mrmailbox_t*, uint32_t id);
    362 int mrmailbox_real_contact_exists__ (mrmailbox_t*, uint32_t id);
    363 int mrmailbox_contact_addr_equals__ (mrmailbox_t*, uint32_t contact_id, const char* other_addr);
    364 void mrmailbox_scaleup_contact_origin__ (mrmailbox_t*, uint32_t contact_id, int origin);
    365 void mrmailbox_unarchive_chat__ (mrmailbox_t*, uint32_t chat_id);
    366 size_t mrmailbox_get_chat_cnt__ (mrmailbox_t*);
    367 uint32_t mrmailbox_create_or_lookup_nchat_by_contact_id__ (mrmailbox_t*, uint32_t contact_id);
    368 uint32_t mrmailbox_lookup_real_nchat_by_contact_id__ (mrmailbox_t*, uint32_t contact_id);
    369 int mrmailbox_get_total_msg_count__ (mrmailbox_t*, uint32_t chat_id);
    370 int mrmailbox_get_fresh_msg_count__ (mrmailbox_t*, uint32_t chat_id);
    371 uint32_t mrmailbox_get_last_deaddrop_fresh_msg__ (mrmailbox_t*);
    372 void mrmailbox_send_msg_to_smtp (mrmailbox_t*, mrjob_t*);
    373 void mrmailbox_send_msg_to_imap (mrmailbox_t*, mrjob_t*);
    374 int mrmailbox_add_contact_to_chat__ (mrmailbox_t*, uint32_t chat_id, uint32_t contact_id);
    375 int mrmailbox_is_contact_in_chat__ (mrmailbox_t*, uint32_t chat_id, uint32_t contact_id);
    376 int mrmailbox_get_chat_contact_count__ (mrmailbox_t*, uint32_t chat_id);
    377 int mrmailbox_group_explicitly_left__ (mrmailbox_t*, const char* grpid);
    378 void mrmailbox_set_group_explicitly_left__ (mrmailbox_t*, const char* grpid);
    379 size_t mrmailbox_get_real_msg_cnt__ (mrmailbox_t*); /* the number of messages assigned to real chat (!=deaddrop, !=trash) */
    380 size_t mrmailbox_get_deaddrop_msg_cnt__ (mrmailbox_t*);
    381 int mrmailbox_rfc724_mid_cnt__ (mrmailbox_t*, const char* rfc724_mid);
    382 int mrmailbox_rfc724_mid_exists__ (mrmailbox_t*, const char* rfc724_mid, char** ret_server_folder, uint32_t* ret_server_uid);
    383 void mrmailbox_update_server_uid__ (mrmailbox_t*, const char* rfc724_mid, const char* server_folder, uint32_t server_uid);
    384 void mrmailbox_update_msg_chat_id__ (mrmailbox_t*, uint32_t msg_id, uint32_t chat_id);
    385 void mrmailbox_update_msg_state__ (mrmailbox_t*, uint32_t msg_id, int state);
    386 void mrmailbox_delete_msg_on_imap (mrmailbox_t* mailbox, mrjob_t* job);
    387 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 */
    388 void mrmailbox_send_mdn (mrmailbox_t*, mrjob_t* job);
    389 void mrmailbox_markseen_msg_on_imap (mrmailbox_t* mailbox, mrjob_t* job);
    390 void mrmailbox_markseen_mdn_on_imap (mrmailbox_t* mailbox, mrjob_t* job);
    391 
    392 
    393 /* library private: end-to-end-encryption */
    394 #define MR_E2EE_DEFAULT_ENABLED 1
    395 #define MR_MDNS_DEFAULT_ENABLED 1
    396 
    397 typedef struct mrmailbox_e2ee_helper_t {
    398  int m_encryption_successfull;
    399  void* m_cdata_to_free;
    400 } mrmailbox_e2ee_helper_t;
    401 
    402 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*);
    403 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 */
    404 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! */
    405 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 */
    406 
    407 
    408 #ifdef __cplusplus
    409 } /* /extern "C" */
    410 #endif
    411 #endif /* __MRMAILBOX_H__ */
    int mrmailbox_add_address_book(mrmailbox_t *mailbox, const char *adr_book)
    Add a number of contacts.
    Definition: mrmailbox.c:4116
    +
    uint32_t mrmailbox_create_group_chat(mrmailbox_t *mailbox, const char *chat_name)
    Create a new group chat.
    Definition: mrmailbox.c:3408
    +
    uint32_t mrmailbox_create_contact(mrmailbox_t *mailbox, const char *name, const char *addr)
    Add a single contact.
    Definition: mrmailbox.c:4076
    +
    uint32_t mrmailbox_send_text_msg(mrmailbox_t *mailbox, uint32_t chat_id, const char *text_to_send)
    Send a simple text message to the given chat.
    Definition: mrmailbox.c:3098
    void mrmailbox_close(mrmailbox_t *mailbox)
    Close mailbox database.
    Definition: mrmailbox.c:1081
    mrmailbox_t * mrmailbox_new(mrmailboxcb_t cb, void *userdata, const char *os_name)
    Create a new mailbox object.
    Definition: mrmailbox.c:898
    -
    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:3645
    +
    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:3646
    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:1697
    -
    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:3762
    +
    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:3763
    int mrmailbox_open(mrmailbox_t *mailbox, const char *dbfile, const char *blobdir)
    Open mailbox database.
    Definition: mrmailbox.c:1016
    An object representing a single contact in memory.
    Definition: mrcontact.h:38
    An object representing 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:2108
    -
    int mrmailbox_delete_contact(mrmailbox_t *mailbox, uint32_t contact_id)
    Delete a contact.
    Definition: mrmailbox.c:4603
    +
    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:2109
    +
    int mrmailbox_delete_contact(mrmailbox_t *mailbox, uint32_t contact_id)
    Delete a contact.
    Definition: mrmailbox.c:4604
    An object representing a single chatlist in memory.
    Definition: mrchatlist.h:43
    void mrmailbox_heartbeat(mrmailbox_t *ths)
    Stay alive.
    Definition: mrmailbox.c:1621
    -
    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:5048
    +
    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:5049
    int mrmailbox_set_config(mrmailbox_t *ths, const char *key, const char *value)
    Configure the mailbox.
    Definition: mrmailbox.c:1182
    char * m_dbfile
    The database file.
    Definition: mrmailbox.h:187
    An object representing a single mailbox.
    Definition: mrmailbox.h:184
    -
    void mrmailbox_delete_msgs(mrmailbox_t *mailbox, const uint32_t *msg_ids, int msg_cnt)
    Delete messages.
    Definition: mrmailbox.c:5190
    +
    void mrmailbox_delete_msgs(mrmailbox_t *mailbox, const uint32_t *msg_ids, int msg_cnt)
    Delete messages.
    Definition: mrmailbox.c:5191
    int mrmailbox_is_open(const mrmailbox_t *mailbox)
    Check if the mailbox database is open.
    Definition: mrmailbox.c:1115
    -
    void mrmailbox_archive_chat(mrmailbox_t *mailbox, uint32_t chat_id, int archive)
    Archive or unarchive a chat.
    Definition: mrmailbox.c:2646
    +
    void mrmailbox_archive_chat(mrmailbox_t *mailbox, uint32_t chat_id, int archive)
    Archive or unarchive a chat.
    Definition: mrmailbox.c:2647
    char * mrmailbox_get_info(mrmailbox_t *mailbox)
    Get information about the mailbox.
    Definition: mrmailbox.c:1283
    -
    mrarray_t * mrmailbox_get_blocked_contacts(mrmailbox_t *mailbox)
    Get blocked contacts.
    Definition: mrmailbox.c:4234
    -
    mrarray_t * mrmailbox_get_known_contacts(mrmailbox_t *mailbox, const char *query)
    Returns known and unblocked contacts.
    Definition: mrmailbox.c:4170
    -
    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:3677
    -
    uint32_t mrmailbox_get_next_media(mrmailbox_t *mailbox, uint32_t curr_msg_id, int dir)
    Returns all message IDs of the given types in a chat.
    Definition: mrmailbox.c:1915
    +
    mrarray_t * mrmailbox_get_blocked_contacts(mrmailbox_t *mailbox)
    Get blocked contacts.
    Definition: mrmailbox.c:4235
    +
    mrarray_t * mrmailbox_get_known_contacts(mrmailbox_t *mailbox, const char *query)
    Returns known and unblocked contacts.
    Definition: mrmailbox.c:4171
    +
    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:3678
    +
    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:1916
    char * mrmailbox_get_version_str(void)
    Find out the version of the Delta Chat core library.
    Definition: mrmailbox.c:1481
    void mrmailbox_disconnect(mrmailbox_t *mailbox)
    Disonnect the mailbox from the server.
    Definition: mrmailbox.c:1596
    char * m_blobdir
    Full path of the blob directory.
    Definition: mrmailbox.h:188
    -
    uint32_t mrmailbox_send_msg(mrmailbox_t *mailbox, uint32_t chat_id, mrmsg_t *msg)
    Send a message of any type to a chat.
    Definition: mrmailbox.c:3213
    +
    uint32_t mrmailbox_send_msg(mrmailbox_t *mailbox, uint32_t chat_id, mrmsg_t *msg)
    Send a message of any type to a chat.
    Definition: mrmailbox.c:3214
    void mrmailbox_connect(mrmailbox_t *mailbox)
    Connect to the mailbox using the configured settings.
    Definition: mrmailbox.c:1569
    -
    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:2578
    -
    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:3141
    +
    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:2579
    +
    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:3142
    void mrmailbox_unref(mrmailbox_t *mailbox)
    Free a mailbox object.
    Definition: mrmailbox.c:955
    -
    void mrmailbox_block_contact(mrmailbox_t *mailbox, uint32_t contact_id, int new_blocking)
    Block or unblock a contact.
    Definition: mrmailbox.c:4384
    +
    void mrmailbox_block_contact(mrmailbox_t *mailbox, uint32_t contact_id, int new_blocking)
    Block or unblock a contact.
    Definition: mrmailbox.c:4385
    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:174
    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:1653
    An object representing a single message in memory.
    Definition: mrmsg.h:40
    uint32_t mrmailbox_get_chat_id_by_contact_id(mrmailbox_t *mailbox, uint32_t contact_id)
    Check, if there is a normal chat with a given contact.
    Definition: mrmailbox.c:1777
    -
    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:2606
    -
    void mrmailbox_delete_chat(mrmailbox_t *mailbox, uint32_t chat_id)
    Delete a chat.
    Definition: mrmailbox.c:2767
    -
    void mrmailbox_set_draft(mrmailbox_t *mailbox, uint32_t chat_id, const char *msg)
    Save a draft for a chat.
    Definition: mrmailbox.c:2361
    -
    int mrmailbox_get_blocked_count(mrmailbox_t *mailbox)
    Get the number of blocked contacts.
    Definition: mrmailbox.c:4268
    -
    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:2212
    -
    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:4795
    +
    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:2607
    +
    void mrmailbox_delete_chat(mrmailbox_t *mailbox, uint32_t chat_id)
    Delete a chat.
    Definition: mrmailbox.c:2768
    +
    void mrmailbox_set_draft(mrmailbox_t *mailbox, uint32_t chat_id, const char *msg)
    Save a draft for a chat.
    Definition: mrmailbox.c:2362
    +
    int mrmailbox_get_blocked_count(mrmailbox_t *mailbox)
    Get the number of blocked contacts.
    Definition: mrmailbox.c:4269
    +
    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:2213
    +
    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:4796
    void * m_userdata
    Use data, may be used for any purpose.
    Definition: mrmailbox.h:186
    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:3556
    +
    int mrmailbox_set_chat_profile_image(mrmailbox_t *mailbox, uint32_t chat_id, const char *new_image)
    Set group profile image.
    Definition: mrmailbox.c:3557
    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:1804
    -
    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:4962
    -
    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:5331
    -
    mrarray_t * mrmailbox_get_chat_contacts(mrmailbox_t *mailbox, uint32_t chat_id)
    Get contact IDs belonging to a chat.
    Definition: mrmailbox.c:1991
    +
    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:4963
    +
    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:5332
    +
    mrarray_t * mrmailbox_get_chat_contacts(mrmailbox_t *mailbox, uint32_t chat_id)
    Get contact IDs belonging to a chat.
    Definition: mrmailbox.c:1992
    void mrmailbox_marknoticed_chat(mrmailbox_t *mailbox, uint32_t chat_id)
    Mark all message in a chat as noticed.
    Definition: mrmailbox.c:1743
    char * mrmailbox_imex_has_backup(mrmailbox_t *mailbox, const char *dir_name)
    Check if there is a backup file.
    Definition: mrmailbox_imex.c:697
    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:2040
    -
    mrcontact_t * mrmailbox_get_contact(mrmailbox_t *mailbox, uint32_t contact_id)
    Get a single contact object.
    Definition: mrmailbox.c:4310
    +
    mrarray_t * mrmailbox_get_fresh_msgs(mrmailbox_t *mailbox)
    Returns the message IDs of all fresh messages of any chat.
    Definition: mrmailbox.c:2041
    +
    mrcontact_t * mrmailbox_get_contact(mrmailbox_t *mailbox, uint32_t contact_id)
    Get a single contact object.
    Definition: mrmailbox.c:4311
    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:1051
    -
    void mrmailbox_marknoticed_contact(mrmailbox_t *mailbox, uint32_t contact_id)
    Mark all messages send by the given contact as noticed.
    Definition: mrmailbox.c:4358
    +
    void mrmailbox_marknoticed_contact(mrmailbox_t *mailbox, uint32_t contact_id)
    Mark all messages send by the given contact as noticed.
    Definition: mrmailbox.c:4359
    int mrmailbox_set_config_int(mrmailbox_t *ths, const char *key, int32_t value)
    Configure the mailbox.
    Definition: mrmailbox.c:1235
    int32_t mrmailbox_get_config_int(mrmailbox_t *ths, const char *key, int32_t def)
    Get a configuration option.
    Definition: mrmailbox.c:1257
    -
    int mrmailbox_set_chat_name(mrmailbox_t *mailbox, uint32_t chat_id, const char *new_name)
    Set group name.
    Definition: mrmailbox.c:3475
    +
    int mrmailbox_set_chat_name(mrmailbox_t *mailbox, uint32_t chat_id, const char *new_name)
    Set group name.
    Definition: mrmailbox.c:3476
    char * mrmailbox_create_setup_code(mrmailbox_t *mailbox)
    Create random setup code.
    Definition: mrmailbox_imex.c:1108
    -
    char * mrmailbox_get_contact_encrinfo(mrmailbox_t *mailbox, uint32_t contact_id)
    Get encryption info for a contact.
    Definition: mrmailbox.c:4475
    +
    char * mrmailbox_get_contact_encrinfo(mrmailbox_t *mailbox, uint32_t contact_id)
    Get encryption info for a contact.
    Definition: mrmailbox.c:4476
    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:1884
    void mrmailbox_imex(mrmailbox_t *mailbox, int what, const char *param1, const char *setup_code)
    Import/export things.
    Definition: mrmailbox_imex.c:998
    char * mrmailbox_get_config(mrmailbox_t *ths, const char *key, const char *def)
    Get a configuration option.
    Definition: mrmailbox.c:1213
    -
    char * mrmailbox_get_msg_info(mrmailbox_t *mailbox, uint32_t msg_id)
    Get an informational text for a single message.
    Definition: mrmailbox.c:4837
    +
    char * mrmailbox_get_msg_info(mrmailbox_t *mailbox, uint32_t msg_id)
    Get an informational text for a single message.
    Definition: mrmailbox.c:4838
    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 d305d5cb..9c3af0de 100644 --- a/docs/html/mrmsg_8h_source.html +++ b/docs/html/mrmsg_8h_source.html @@ -89,43 +89,42 @@ 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 {
    52  uint32_t m_id;
    53  #define MR_MSG_ID_MARKER1 1
    54  #define MR_MSG_ID_DAYMARKER 9
    55  #define MR_MSG_ID_LAST_SPECIAL 9
    56 
    57 
    62  uint32_t m_from_id;
    63 
    64 
    69  uint32_t m_to_id;
    70 
    71 
    76  uint32_t m_chat_id;
    77 
    78 
    82  time_t m_timestamp;
    83 
    84 
    88  int m_type;
    89  #define MR_MSG_UNDEFINED 0
    90  #define MR_MSG_TEXT 10
    91  #define MR_MSG_IMAGE 20 /* m_param may contain MRP_FILE, MRP_WIDTH, MRP_HEIGHT */
    92  #define MR_MSG_GIF 21 /* - " - */
    93  #define MR_MSG_AUDIO 40 /* m_param may contain MRP_FILE, MRP_DURATION */
    94  #define MR_MSG_VOICE 41 /* - " - */
    95  #define MR_MSG_VIDEO 50 /* m_param may contain MRP_FILE, MRP_WIDTH, MRP_HEIGHT, MRP_DURATION */
    96  #define MR_MSG_FILE 60 /* m_param may contain MRP_FILE */
    97 
    98 
    102  int m_state;
    103  #define MR_STATE_UNDEFINED 0
    104  #define MR_STATE_IN_FRESH 10
    105  #define MR_STATE_IN_NOTICED 13
    106  #define MR_STATE_IN_SEEN 16
    107  #define MR_STATE_OUT_PENDING 20
    108  #define MR_STATE_OUT_ERROR 24
    109  #define MR_STATE_OUT_DELIVERED 26
    110  #define MR_STATE_OUT_MDN_RCVD 28
    111 
    112  char* m_text;
    114  int m_starred;
    118  mrmailbox_t* m_mailbox;
    119  char* m_rfc724_mid;
    120  char* m_server_folder;
    121  uint32_t m_server_uid;
    122  int m_is_msgrmsg;
    123 } mrmsg_t;
    124 
    125 
    126 mrmsg_t* mrmsg_new ();
    127 void mrmsg_unref (mrmsg_t*);
    128 void mrmsg_empty (mrmsg_t*);
    129 
    130 void mrmsg_set_type (mrmsg_t*, int type);
    131 void mrmsg_set_text (mrmsg_t*, const char* text);
    132 void mrmsg_set_file (mrmsg_t*, const char* file);
    133 
    134 int mrmsg_get_type (mrmsg_t*);
    135 int mrmsg_get_state (mrmsg_t*);
    136 char* mrmsg_get_text (mrmsg_t*);
    137 char* mrmsg_get_file (mrmsg_t*);
    138 char* mrmsg_get_filename (mrmsg_t*);
    139 char* mrmsg_get_filemime (mrmsg_t*);
    140 uint64_t mrmsg_get_filebytes (mrmsg_t*);
    142 int mrmsg_get_width (mrmsg_t*);
    147 char* mrmsg_get_summarytext (mrmsg_t*, int approx_characters);
    151 
    153 
    154 
    155 /* library-private */
    156 #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 "
    157 int mrmsg_set_from_stmt__ (mrmsg_t*, sqlite3_stmt* row, int row_offset); /* row order is MR_MSG_FIELDS */
    158 int mrmsg_load_from_db__ (mrmsg_t*, mrmailbox_t*, uint32_t id);
    159 int mrmsg_is_increation__ (const mrmsg_t*);
    160 char* mrmsg_get_summarytext_by_raw (int type, const char* text, mrparam_t*, int approx_bytes); /* the returned value must be free()'d */
    161 void mrmsg_save_param_to_disk__ (mrmsg_t*);
    162 void mrmsg_guess_msgtype_from_suffix (const char* pathNfilename, int* ret_msgtype, char** ret_mime);
    163 void mrmsg_get_authorNtitle_from_filename (const char* pathNfilename, char** ret_author, char** ret_title);
    164 
    165 #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)
    166 #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. */
    167 #define MR_MSG_MAKE_SUFFIX_SEARCHABLE(a) ((a)==MR_MSG_IMAGE || (a)==MR_MSG_GIF || (a)==MR_MSG_VOICE)
    168 
    169 #define APPROX_SUBJECT_CHARS 32 /* as we do not cut inside words, this results in about 32-42 characters.
    170  Do not use too long subjects - we add a tag after the subject which gets truncated by the clients otherwise.
    171  It should also be very clear, the subject is _not_ the whole message.
    172  The value is also used for CC:-summaries */
    173 
    174 
    175 #ifdef __cplusplus
    176 } /* /extern "C" */
    177 #endif
    178 #endif /* __MRMSG_H__ */
    An object representing a single mailbox.
    Definition: mrmailbox.h:184
    -
    int mrmsg_is_systemcmd(mrmsg_t *msg)
    Check if the message is a system command.
    Definition: mrmsg.c:663
    -
    int mrmsg_get_type(mrmsg_t *msg)
    Get the type of the message.
    Definition: mrmsg.c:202
    +
    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 {
    52  uint32_t m_id;
    53  #define MR_MSG_ID_MARKER1 1
    54  #define MR_MSG_ID_DAYMARKER 9
    55  #define MR_MSG_ID_LAST_SPECIAL 9
    56 
    57 
    62  uint32_t m_from_id;
    63 
    64 
    69  uint32_t m_to_id;
    70 
    71 
    76  uint32_t m_chat_id;
    77 
    78 
    82  time_t m_timestamp;
    83 
    84 
    88  int m_type;
    89  #define MR_MSG_UNDEFINED 0
    90  #define MR_MSG_TEXT 10
    91  #define MR_MSG_IMAGE 20 /* m_param may contain MRP_FILE, MRP_WIDTH, MRP_HEIGHT */
    92  #define MR_MSG_GIF 21 /* - " - */
    93  #define MR_MSG_AUDIO 40 /* m_param may contain MRP_FILE, MRP_DURATION */
    94  #define MR_MSG_VOICE 41 /* - " - */
    95  #define MR_MSG_VIDEO 50 /* m_param may contain MRP_FILE, MRP_WIDTH, MRP_HEIGHT, MRP_DURATION */
    96  #define MR_MSG_FILE 60 /* m_param may contain MRP_FILE */
    97 
    98 
    102  int m_state;
    103  #define MR_STATE_UNDEFINED 0
    104  #define MR_STATE_IN_FRESH 10
    105  #define MR_STATE_IN_NOTICED 13
    106  #define MR_STATE_IN_SEEN 16
    107  #define MR_STATE_OUT_PENDING 20
    108  #define MR_STATE_OUT_ERROR 24
    109  #define MR_STATE_OUT_DELIVERED 26
    110  #define MR_STATE_OUT_MDN_RCVD 28
    111 
    112  char* m_text;
    114  int m_starred;
    118  mrmailbox_t* m_mailbox;
    119  char* m_rfc724_mid;
    120  char* m_server_folder;
    121  uint32_t m_server_uid;
    122  int m_is_msgrmsg;
    123 } mrmsg_t;
    124 
    125 
    126 mrmsg_t* mrmsg_new ();
    127 void mrmsg_unref (mrmsg_t*);
    128 void mrmsg_empty (mrmsg_t*);
    129 
    130 void mrmsg_set_type (mrmsg_t*, int type);
    131 void mrmsg_set_text (mrmsg_t*, const char* text);
    132 void mrmsg_set_file (mrmsg_t*, const char* file);
    133 
    134 int mrmsg_get_type (mrmsg_t*);
    135 int mrmsg_get_state (mrmsg_t*);
    136 char* mrmsg_get_text (mrmsg_t*);
    137 char* mrmsg_get_file (mrmsg_t*);
    138 char* mrmsg_get_filename (mrmsg_t*);
    139 char* mrmsg_get_filemime (mrmsg_t*);
    140 uint64_t mrmsg_get_filebytes (mrmsg_t*);
    142 int mrmsg_get_width (mrmsg_t*);
    147 char* mrmsg_get_summarytext (mrmsg_t*, int approx_characters);
    151 
    152 void mrmsg_latefiling_mediasize (mrmsg_t*, int width, int height, int duration);
    153 
    154 
    155 /* library-private */
    156 #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 "
    157 int mrmsg_set_from_stmt__ (mrmsg_t*, sqlite3_stmt* row, int row_offset); /* row order is MR_MSG_FIELDS */
    158 int mrmsg_load_from_db__ (mrmsg_t*, mrmailbox_t*, uint32_t id);
    159 int mrmsg_is_increation__ (const mrmsg_t*);
    160 char* mrmsg_get_summarytext_by_raw (int type, const char* text, mrparam_t*, int approx_bytes); /* the returned value must be free()'d */
    161 void mrmsg_save_param_to_disk__ (mrmsg_t*);
    162 void mrmsg_guess_msgtype_from_suffix (const char* pathNfilename, int* ret_msgtype, char** ret_mime);
    163 void mrmsg_get_authorNtitle_from_filename (const char* pathNfilename, char** ret_author, char** ret_title);
    164 
    165 #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)
    166 #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. */
    167 #define MR_MSG_MAKE_SUFFIX_SEARCHABLE(a) ((a)==MR_MSG_IMAGE || (a)==MR_MSG_GIF || (a)==MR_MSG_VOICE)
    168 
    169 #define APPROX_SUBJECT_CHARS 32 /* as we do not cut inside words, this results in about 32-42 characters.
    170  Do not use too long subjects - we add a tag after the subject which gets truncated by the clients otherwise.
    171  It should also be very clear, the subject is _not_ the whole message.
    172  The value is also used for CC:-summaries */
    173 
    174 
    175 #ifdef __cplusplus
    176 } /* /extern "C" */
    177 #endif
    178 #endif /* __MRMSG_H__ */
    An object representing a single mailbox.
    Definition: mrmailbox.h:184
    +
    int mrmsg_is_systemcmd(mrmsg_t *msg)
    Check if the message is a system command.
    Definition: mrmsg.c:661
    +
    int mrmsg_get_type(mrmsg_t *msg)
    Get the type of the message.
    Definition: mrmsg.c:200
    int m_type
    Message type.
    Definition: mrmsg.h:88
    -
    char * mrmsg_get_summarytext(mrmsg_t *msg, int approx_characters)
    Get a message summary as a single line of text.
    Definition: mrmsg.c:608
    -
    uint64_t mrmsg_get_filebytes(mrmsg_t *msg)
    Get the size of the file.
    Definition: mrmsg.c:379
    +
    char * mrmsg_get_summarytext(mrmsg_t *msg, int approx_characters)
    Get a message summary as a single line of text.
    Definition: mrmsg.c:606
    +
    uint64_t mrmsg_get_filebytes(mrmsg_t *msg)
    Get the size of the file.
    Definition: mrmsg.c:377
    uint32_t m_chat_id
    Chat ID the message belongs to.
    Definition: mrmsg.h:76
    -
    int mrmsg_get_state(mrmsg_t *msg)
    Get the state of a message.
    Definition: mrmsg.c:238
    +
    int mrmsg_get_state(mrmsg_t *msg)
    Get the state of a message.
    Definition: mrmsg.c:236
    mrmsg_t * mrmsg_new()
    Create new message object.
    Definition: mrmsg.c:41
    An object representing text with some attributes.
    Definition: mrpoortext.h:35
    -
    mrpoortext_t * mrmsg_get_summary(mrmsg_t *msg, mrchat_t *chat)
    Get a summary for a message.
    Definition: mrmsg.c:566
    -
    void mrmsg_set_file(mrmsg_t *msg, const char *file)
    Set the file belonging to a message.
    Definition: mrmsg.c:177
    -
    mrpoortext_t * mrmsg_get_mediainfo(mrmsg_t *msg)
    Get real author and title.
    Definition: mrmsg.c:412
    +
    mrpoortext_t * mrmsg_get_summary(mrmsg_t *msg, mrchat_t *chat)
    Get a summary for a message.
    Definition: mrmsg.c:564
    +
    void mrmsg_set_file(mrmsg_t *msg, const char *file)
    Set the file belonging to a message.
    Definition: mrmsg.c:175
    +
    mrpoortext_t * mrmsg_get_mediainfo(mrmsg_t *msg)
    Get real author and title.
    Definition: mrmsg.c:410
    An object representing a single message in memory.
    Definition: mrmsg.h:40
    uint32_t m_to_id
    Contact ID of the recipient.
    Definition: mrmsg.h:69
    uint32_t m_from_id
    Contact ID of the sender.
    Definition: mrmsg.h:62
    -
    int mrmsg_get_duration(mrmsg_t *msg)
    Get duration of audio or video.
    Definition: mrmsg.c:520
    -
    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:279
    +
    int mrmsg_get_duration(mrmsg_t *msg)
    Get duration of audio or video.
    Definition: mrmsg.c:518
    +
    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:277
    int m_starred
    Starred-state of the message.
    Definition: mrmsg.h:114
    -
    void mrmsg_set_text(mrmsg_t *msg, const char *text)
    Set the text of a message object.
    Definition: mrmsg.c:153
    +
    void mrmsg_set_text(mrmsg_t *msg, const char *text)
    Set the text of a message object.
    Definition: mrmsg.c:151
    An object for handling key=value parameter lists.
    Definition: mrparam.h:44
    -
    int mrmsg_is_increation(mrmsg_t *msg)
    Check if a message is still in creation.
    Definition: mrmsg.c:903
    +
    int mrmsg_is_increation(mrmsg_t *msg)
    Check if a message is still in creation.
    Definition: mrmsg.c:901
    mrparam_t * m_param
    Additional paramter for the message.
    Definition: mrmsg.h:113
    char * m_text
    Message text.
    Definition: mrmsg.h:112
    -
    void mrmsg_unref(mrmsg_t *msg)
    Free an mrmsg_t object created eg.
    Definition: mrmsg.c:68
    -
    void mrmsg_set_type(mrmsg_t *msg, int type)
    Set the type of a message.
    Definition: mrmsg.c:126
    +
    void mrmsg_unref(mrmsg_t *msg)
    Free a message object.
    Definition: mrmsg.c:66
    +
    void mrmsg_set_type(mrmsg_t *msg, int type)
    Set the type of a message.
    Definition: mrmsg.c:124
    uint32_t m_id
    Message ID.
    Definition: mrmsg.h:52
    int m_state
    Message state.
    Definition: mrmsg.h:102
    -
    char * mrmsg_get_filemime(mrmsg_t *msg)
    Get mime type of the file.
    Definition: mrmsg.c:338
    -
    int mrmsg_get_width(mrmsg_t *msg)
    Get width of image or video.
    Definition: mrmsg.c:473
    -
    int mrmsg_get_showpadlock(mrmsg_t *msg)
    Check if a padlock should be shown beside the message.
    Definition: mrmsg.c:538
    -
    void mrmsg_save_param_to_disk(mrmsg_t *msg)
    Add additional, persistent information to a message record.
    Definition: mrmsg.c:946
    -
    char * mrmsg_get_filename(mrmsg_t *msg)
    Get base file name without path.
    Definition: mrmsg.c:306
    -
    void mrmsg_empty(mrmsg_t *msg)
    Empty a message object.
    Definition: mrmsg.c:89
    -
    char * mrmsg_get_text(mrmsg_t *msg)
    Get the text of the message.
    Definition: mrmsg.c:258
    -
    int mrmsg_is_forwarded(mrmsg_t *msg)
    Check if the message is a forwarded message.
    Definition: mrmsg.c:636
    -
    int mrmsg_get_height(mrmsg_t *msg)
    Get height of image or video.
    Definition: mrmsg.c:498
    +
    char * mrmsg_get_filemime(mrmsg_t *msg)
    Get mime type of the file.
    Definition: mrmsg.c:336
    +
    int mrmsg_get_width(mrmsg_t *msg)
    Get width of image or video.
    Definition: mrmsg.c:471
    +
    int mrmsg_get_showpadlock(mrmsg_t *msg)
    Check if a padlock should be shown beside the message.
    Definition: mrmsg.c:536
    +
    char * mrmsg_get_filename(mrmsg_t *msg)
    Get base file name without path.
    Definition: mrmsg.c:304
    +
    void mrmsg_empty(mrmsg_t *msg)
    Empty a message object.
    Definition: mrmsg.c:87
    +
    char * mrmsg_get_text(mrmsg_t *msg)
    Get the text of the message.
    Definition: mrmsg.c:256
    +
    int mrmsg_is_forwarded(mrmsg_t *msg)
    Check if the message is a forwarded message.
    Definition: mrmsg.c:634
    +
    int mrmsg_get_height(mrmsg_t *msg)
    Get height of image or video.
    Definition: mrmsg.c:496
    time_t m_timestamp
    Unix time the message was sended or received.
    Definition: mrmsg.h:82
    An object representing a single chat in memory.
    Definition: mrchat.h:39
    diff --git a/docs/html/search/all_1.js b/docs/html/search/all_1.js index c246f9bd..ceedd1ec 100644 --- a/docs/html/search/all_1.js +++ b/docs/html/search/all_1.js @@ -148,8 +148,8 @@ var searchData= ['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_5fsystemcmd',['mrmsg_is_systemcmd',['../structmrmsg__t.html#a752209192e3a022d087fe6c647fb3ad9',1,'mrmsg_t']]], + ['mrmsg_5flatefiling_5fmediasize',['mrmsg_latefiling_mediasize',['../structmrmailbox__t.html#a9e5dc81d4e814284b465ad23abbfb6cb',1,'mrmailbox_t']]], ['mrmsg_5fnew',['mrmsg_new',['../structmrmsg__t.html#a80f470eb34af414ff28e7d3b3c715b48',1,'mrmsg_t']]], - ['mrmsg_5fsave_5fparam_5fto_5fdisk',['mrmsg_save_param_to_disk',['../structmrmsg__t.html#a0bc3ce5f2ef0065547e4aee0143d22ef',1,'mrmsg_t']]], ['mrmsg_5fset_5ffile',['mrmsg_set_file',['../structmrmsg__t.html#a98455bee60d64b3d59d89fbbb520ddd5',1,'mrmsg_t']]], ['mrmsg_5fset_5ftext',['mrmsg_set_text',['../structmrmsg__t.html#ae940aa79a261e1a427b12baefbee2d23',1,'mrmsg_t']]], ['mrmsg_5fset_5ftype',['mrmsg_set_type',['../structmrmsg__t.html#a3581e331fe9f3f38d4c5bb1b1c8c7867',1,'mrmsg_t']]], diff --git a/docs/html/search/functions_0.js b/docs/html/search/functions_0.js index d5459d82..5d377939 100644 --- a/docs/html/search/functions_0.js +++ b/docs/html/search/functions_0.js @@ -99,8 +99,8 @@ var searchData= ['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_5fsystemcmd',['mrmsg_is_systemcmd',['../structmrmsg__t.html#a752209192e3a022d087fe6c647fb3ad9',1,'mrmsg_t']]], + ['mrmsg_5flatefiling_5fmediasize',['mrmsg_latefiling_mediasize',['../structmrmailbox__t.html#a9e5dc81d4e814284b465ad23abbfb6cb',1,'mrmailbox_t']]], ['mrmsg_5fnew',['mrmsg_new',['../structmrmsg__t.html#a80f470eb34af414ff28e7d3b3c715b48',1,'mrmsg_t']]], - ['mrmsg_5fsave_5fparam_5fto_5fdisk',['mrmsg_save_param_to_disk',['../structmrmsg__t.html#a0bc3ce5f2ef0065547e4aee0143d22ef',1,'mrmsg_t']]], ['mrmsg_5fset_5ffile',['mrmsg_set_file',['../structmrmsg__t.html#a98455bee60d64b3d59d89fbbb520ddd5',1,'mrmsg_t']]], ['mrmsg_5fset_5ftext',['mrmsg_set_text',['../structmrmsg__t.html#ae940aa79a261e1a427b12baefbee2d23',1,'mrmsg_t']]], ['mrmsg_5fset_5ftype',['mrmsg_set_type',['../structmrmsg__t.html#a3581e331fe9f3f38d4c5bb1b1c8c7867',1,'mrmsg_t']]], diff --git a/docs/html/structmrmailbox__t-members.html b/docs/html/structmrmailbox__t-members.html index 55394e36..1adc4ec5 100644 --- a/docs/html/structmrmailbox__t-members.html +++ b/docs/html/structmrmailbox__t-members.html @@ -154,6 +154,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); 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 + mrmsg_latefiling_mediasize(mrmsg_t *msg, int width, int height, int duration)mrmailbox_t