From 1bea2d3db7ea6cce8671dbc488eb250920c7e374 Mon Sep 17 00:00:00 2001 From: "B. Petersen" Date: Thu, 23 Nov 2017 17:37:17 +0100 Subject: [PATCH] doxygen --- docs/html/functions.html | 55 ++- docs/html/functions_func.html | 39 +- docs/html/functions_vars.html | 25 +- docs/html/index.html | 2 +- docs/html/mrevent_8h.html | 8 +- docs/html/mrmailbox_8h_source.html | 54 +-- docs/html/mrmsg_8h_source.html | 58 ++- docs/html/search/all_1.js | 24 +- docs/html/search/functions_0.js | 15 +- docs/html/search/variables_0.js | 9 +- docs/html/structmrchat__t.html | 2 +- docs/html/structmrmailbox__t-members.html | 7 +- docs/html/structmrmailbox__t.html | 464 ++++++++++++++++------ docs/html/structmrmsg__t-members.html | 42 +- docs/html/structmrmsg__t.html | 407 ++++++------------- docs/html/structmrparam__t.html | 2 +- 16 files changed, 620 insertions(+), 593 deletions(-) diff --git a/docs/html/functions.html b/docs/html/functions.html index 1d3e0a51..5f1e7dac 100644 --- a/docs/html/functions.html +++ b/docs/html/functions.html @@ -141,18 +141,8 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : mrchat_t , mrcontact_t -
  • m_param -: mrmsg_t -
  • -
  • m_starred -: mrmsg_t -
  • m_state -: mrmsg_t -, mrpoortext_t -
  • -
  • m_text -: mrmsg_t +: mrpoortext_t
  • m_text1 : mrpoortext_t @@ -164,15 +154,13 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : mrpoortext_t
  • m_timestamp -: mrmsg_t -, mrpoortext_t +: mrpoortext_t
  • m_to_id : mrmsg_t
  • m_type : mrchat_t -, mrmsg_t
  • m_userdata : mrmailbox_t @@ -390,8 +378,14 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • mrmailbox_search_msgs() : mrmailbox_t
  • -
  • mrmailbox_send_msg() -: mrmailbox_t +
  • mrmailbox_send_audio_msg() +: mrmailbox_t +
  • +
  • mrmailbox_send_file_msg() +: mrmailbox_t +
  • +
  • mrmailbox_send_image_msg() +: mrmailbox_t
  • mrmailbox_send_text_msg() : mrmailbox_t @@ -399,6 +393,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • mrmailbox_send_vcard_msg() : mrmailbox_t
  • +
  • mrmailbox_send_video_msg() +: mrmailbox_t +
  • +
  • mrmailbox_send_voice_msg() +: mrmailbox_t +
  • mrmailbox_set_chat_name() : mrmailbox_t
  • @@ -423,9 +423,6 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • mrmailboxcb_t : mrmailbox_t
  • -
  • mrmsg_empty() -: mrmsg_t -
  • mrmsg_get_duration() : mrmsg_t
  • @@ -462,6 +459,9 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • mrmsg_get_text() : mrmsg_t
  • +
  • mrmsg_get_timestamp() +: mrmsg_t +
  • mrmsg_get_type() : mrmsg_t
  • @@ -474,23 +474,14 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • mrmsg_is_increation() : mrmsg_t
  • +
  • mrmsg_is_starred() +: mrmsg_t +
  • mrmsg_is_systemcmd() : mrmsg_t
  • mrmsg_latefiling_mediasize() -: mrmailbox_t -
  • -
  • mrmsg_new() -: mrmsg_t -
  • -
  • mrmsg_set_file() -: mrmsg_t -
  • -
  • mrmsg_set_text() -: mrmsg_t -
  • -
  • mrmsg_set_type() -: mrmsg_t +: mrmsg_t
  • mrmsg_unref() : mrmsg_t diff --git a/docs/html/functions_func.html b/docs/html/functions_func.html index cf1dc500..d1e3c3ef 100644 --- a/docs/html/functions_func.html +++ b/docs/html/functions_func.html @@ -310,8 +310,14 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • mrmailbox_search_msgs() : mrmailbox_t
  • -
  • mrmailbox_send_msg() -: mrmailbox_t +
  • mrmailbox_send_audio_msg() +: mrmailbox_t +
  • +
  • mrmailbox_send_file_msg() +: mrmailbox_t +
  • +
  • mrmailbox_send_image_msg() +: mrmailbox_t
  • mrmailbox_send_text_msg() : mrmailbox_t @@ -319,6 +325,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • mrmailbox_send_vcard_msg() : mrmailbox_t
  • +
  • mrmailbox_send_video_msg() +: mrmailbox_t +
  • +
  • mrmailbox_send_voice_msg() +: mrmailbox_t +
  • mrmailbox_set_chat_name() : mrmailbox_t
  • @@ -340,9 +352,6 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • mrmailbox_unref() : mrmailbox_t
  • -
  • mrmsg_empty() -: mrmsg_t -
  • mrmsg_get_duration() : mrmsg_t
  • @@ -379,6 +388,9 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • mrmsg_get_text() : mrmsg_t
  • +
  • mrmsg_get_timestamp() +: mrmsg_t +
  • mrmsg_get_type() : mrmsg_t
  • @@ -391,23 +403,14 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • mrmsg_is_increation() : mrmsg_t
  • +
  • mrmsg_is_starred() +: mrmsg_t +
  • mrmsg_is_systemcmd() : mrmsg_t
  • mrmsg_latefiling_mediasize() -: mrmailbox_t -
  • -
  • mrmsg_new() -: mrmsg_t -
  • -
  • mrmsg_set_file() -: mrmsg_t -
  • -
  • mrmsg_set_text() -: mrmsg_t -
  • -
  • mrmsg_set_type() -: mrmsg_t +: mrmsg_t
  • mrmsg_unref() : mrmsg_t diff --git a/docs/html/functions_vars.html b/docs/html/functions_vars.html index 5e2576ff..bd514adc 100644 --- a/docs/html/functions_vars.html +++ b/docs/html/functions_vars.html @@ -73,11 +73,6 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • Typedefs
  • -
    -  - -

    - m -

    -

    A single message is send successfully (state changed from MR_STATE_OUT_PENDING to MR_STATE_OUT_DELIVERED, see mrmsg_t::m_state).

    +

    A single message is send successfully (state changed from MR_STATE_OUT_PENDING to MR_STATE_OUT_DELIVERED, see mrmsg_t::m_state).

    Parameters
    @@ -311,7 +311,7 @@ Macros
    data1chat_id
    -

    A single message is read by the receiver (state changed from MR_STATE_OUT_DELIVERED to MR_STATE_OUT_MDN_RCVD, see mrmsg_t::m_state).

    +

    A single message is read by the receiver (state changed from MR_STATE_OUT_DELIVERED to MR_STATE_OUT_MDN_RCVD, see mrmsg_t::m_state).

    Parameters
    diff --git a/docs/html/mrmailbox_8h_source.html b/docs/html/mrmailbox_8h_source.html index 07ac126c..c72b4b43 100644 --- a/docs/html/mrmailbox_8h_source.html +++ b/docs/html/mrmailbox_8h_source.html @@ -89,44 +89,46 @@ 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: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
    +
    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_image_msg (mrmailbox_t*, uint32_t chat_id, const char* file, const char* filemime, int width, int height);
    259 uint32_t mrmailbox_send_video_msg (mrmailbox_t*, uint32_t chat_id, const char* file, const char* filemime, int width, int height, int duration);
    260 uint32_t mrmailbox_send_voice_msg (mrmailbox_t*, uint32_t chat_id, const char* file, const char* filemime, int duration);
    261 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);
    262 uint32_t mrmailbox_send_file_msg (mrmailbox_t*, uint32_t chat_id, const char* file, const char* filemime);
    263 uint32_t mrmailbox_send_vcard_msg (mrmailbox_t*, uint32_t chat_id, uint32_t contact_id);
    264 void mrmailbox_set_draft (mrmailbox_t*, uint32_t chat_id, const char*);
    265 
    266 #define MR_GCM_ADDDAYMARKER 0x01
    267 mrarray_t* mrmailbox_get_chat_msgs (mrmailbox_t*, uint32_t chat_id, uint32_t flags, uint32_t marker1before);
    268 int mrmailbox_get_total_msg_count (mrmailbox_t*, uint32_t chat_id);
    269 int mrmailbox_get_fresh_msg_count (mrmailbox_t*, uint32_t chat_id);
    270 mrarray_t* mrmailbox_get_fresh_msgs (mrmailbox_t*);
    271 void mrmailbox_marknoticed_chat (mrmailbox_t*, uint32_t chat_id);
    272 mrarray_t* mrmailbox_get_chat_media (mrmailbox_t*, uint32_t chat_id, int msg_type, int or_msg_type);
    273 uint32_t mrmailbox_get_next_media (mrmailbox_t*, uint32_t curr_msg_id, int dir);
    274 
    275 void mrmailbox_archive_chat (mrmailbox_t*, uint32_t chat_id, int archive);
    276 void mrmailbox_delete_chat (mrmailbox_t*, uint32_t chat_id);
    277 
    278 mrarray_t* mrmailbox_get_chat_contacts (mrmailbox_t*, uint32_t chat_id);
    279 mrarray_t* mrmailbox_search_msgs (mrmailbox_t*, uint32_t chat_id, const char* query);
    280 
    281 mrchat_t* mrmailbox_get_chat (mrmailbox_t*, uint32_t chat_id);
    282 
    283 
    284 /* Handle group chats */
    285 uint32_t mrmailbox_create_group_chat (mrmailbox_t*, const char* name);
    286 int mrmailbox_is_contact_in_chat (mrmailbox_t*, uint32_t chat_id, uint32_t contact_id);
    287 int mrmailbox_add_contact_to_chat (mrmailbox_t*, uint32_t chat_id, uint32_t contact_id);
    288 int mrmailbox_remove_contact_from_chat (mrmailbox_t*, uint32_t chat_id, uint32_t contact_id);
    289 int mrmailbox_set_chat_name (mrmailbox_t*, uint32_t chat_id, const char* name);
    290 int mrmailbox_set_chat_profile_image (mrmailbox_t*, uint32_t chat_id, const char* image);
    291 
    292 
    293 /* Handle messages */
    294 char* mrmailbox_get_msg_info (mrmailbox_t*, uint32_t msg_id);
    295 void mrmailbox_delete_msgs (mrmailbox_t*, const uint32_t* msg_ids, int msg_cnt);
    296 void mrmailbox_forward_msgs (mrmailbox_t*, const uint32_t* msg_ids, int msg_cnt, uint32_t chat_id);
    297 void mrmailbox_marknoticed_contact (mrmailbox_t*, uint32_t contact_id);
    298 void mrmailbox_markseen_msgs (mrmailbox_t*, const uint32_t* msg_ids, int msg_cnt);
    299 void mrmailbox_star_msgs (mrmailbox_t*, const uint32_t* msg_ids, int msg_cnt, int star);
    300 mrmsg_t* mrmailbox_get_msg (mrmailbox_t*, uint32_t msg_id);
    301 
    302 
    303 /* Handle contacts */
    304 uint32_t mrmailbox_create_contact (mrmailbox_t*, const char* name, const char* addr);
    305 int mrmailbox_add_address_book (mrmailbox_t*, const char*);
    306 mrarray_t* mrmailbox_get_known_contacts (mrmailbox_t*, const char* query);
    307 int mrmailbox_get_blocked_count (mrmailbox_t*);
    309 void mrmailbox_block_contact (mrmailbox_t*, uint32_t contact_id, int block);
    310 char* mrmailbox_get_contact_encrinfo (mrmailbox_t*, uint32_t contact_id);
    311 int mrmailbox_delete_contact (mrmailbox_t*, uint32_t contact_id);
    312 mrcontact_t* mrmailbox_get_contact (mrmailbox_t*, uint32_t contact_id);
    313 
    314 
    315 /* Import/export and Tools */
    316 #define MR_IMEX_CANCEL 0
    317 #define MR_IMEX_EXPORT_SELF_KEYS 1 /* param1 is a directory where the keys are written to */
    318 #define MR_IMEX_IMPORT_SELF_KEYS 2 /* param1 is a directory where the keys are searched in and read from */
    319 #define MR_IMEX_EXPORT_BACKUP 11 /* param1 is a directory where the backup is written to */
    320 #define MR_IMEX_IMPORT_BACKUP 12 /* param1 is the file with the backup to import */
    321 #define MR_IMEX_EXPORT_SETUP_MESSAGE 20 /* param1 is a directory where the setup file is written to */
    322 #define MR_BAK_PREFIX "delta-chat"
    323 #define MR_BAK_SUFFIX "bak"
    324 void mrmailbox_imex (mrmailbox_t*, int what, const char* param1, const char* setup_code);
    325 char* mrmailbox_imex_has_backup (mrmailbox_t*, const char* dir);
    326 int mrmailbox_check_password (mrmailbox_t*, const char* pw);
    327 char* mrmailbox_create_setup_code (mrmailbox_t*);
    328 void mrmailbox_heartbeat (mrmailbox_t*);
    329 
    330 
    331 /* logging */
    332 void mrmailbox_log_error (mrmailbox_t*, int code, const char* msg, ...);
    333 void mrmailbox_log_error_if (int* condition, mrmailbox_t*, int code, const char* msg, ...);
    334 void mrmailbox_log_warning (mrmailbox_t*, int code, const char* msg, ...);
    335 void mrmailbox_log_info (mrmailbox_t*, int code, const char* msg, ...);
    336 void mrmailbox_log_vprintf (mrmailbox_t*, int event, int code, const char* msg, va_list);
    337 int mrmailbox_get_thread_index (void);
    338 
    339 
    340 /* error codes */
    341 #define MR_ERR_SELF_NOT_IN_GROUP 1
    342 #define MR_ERR_NONETWORK 2
    343 
    344 
    345 /* deprecated functions */
    346 int mrchat_set_draft (mrchat_t*, const char* msg); /* deprecated - use mrmailbox_set_draft() instead */
    347 
    348 
    349 /* library-internal */
    350 uint32_t mrmailbox_send_msg_object (mrmailbox_t*, uint32_t chat_id, mrmsg_t*);
    351 void mrmailbox_connect_to_imap (mrmailbox_t*, mrjob_t*);
    352 void mrmailbox_wake_lock (mrmailbox_t*);
    353 void mrmailbox_wake_unlock (mrmailbox_t*);
    354 int mrmailbox_poke_eml_file (mrmailbox_t*, const char* file);
    355 int mrmailbox_is_reply_to_known_message__ (mrmailbox_t*, mrmimeparser_t*);
    356 int mrmailbox_is_reply_to_messenger_message__ (mrmailbox_t*, mrmimeparser_t*);
    357 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);
    358 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);
    359 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);
    360 int mrmailbox_get_archived_count__ (mrmailbox_t*);
    361 int mrmailbox_reset_tables (mrmailbox_t*, int bits); /* reset tables but leaves server configuration, 1=jobs, 2=e2ee, 8=rest but server config */
    362 size_t mrmailbox_get_real_contact_cnt__ (mrmailbox_t*);
    363 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);
    364 int mrmailbox_get_contact_origin__ (mrmailbox_t*, uint32_t id, int* ret_blocked);
    365 int mrmailbox_is_contact_blocked__ (mrmailbox_t*, uint32_t id);
    366 int mrmailbox_real_contact_exists__ (mrmailbox_t*, uint32_t id);
    367 int mrmailbox_contact_addr_equals__ (mrmailbox_t*, uint32_t contact_id, const char* other_addr);
    368 void mrmailbox_scaleup_contact_origin__ (mrmailbox_t*, uint32_t contact_id, int origin);
    369 void mrmailbox_unarchive_chat__ (mrmailbox_t*, uint32_t chat_id);
    370 size_t mrmailbox_get_chat_cnt__ (mrmailbox_t*);
    371 uint32_t mrmailbox_create_or_lookup_nchat_by_contact_id__ (mrmailbox_t*, uint32_t contact_id);
    372 uint32_t mrmailbox_lookup_real_nchat_by_contact_id__ (mrmailbox_t*, uint32_t contact_id);
    373 int mrmailbox_get_total_msg_count__ (mrmailbox_t*, uint32_t chat_id);
    374 int mrmailbox_get_fresh_msg_count__ (mrmailbox_t*, uint32_t chat_id);
    375 uint32_t mrmailbox_get_last_deaddrop_fresh_msg__ (mrmailbox_t*);
    376 void mrmailbox_send_msg_to_smtp (mrmailbox_t*, mrjob_t*);
    377 void mrmailbox_send_msg_to_imap (mrmailbox_t*, mrjob_t*);
    378 int mrmailbox_add_contact_to_chat__ (mrmailbox_t*, uint32_t chat_id, uint32_t contact_id);
    379 int mrmailbox_is_contact_in_chat__ (mrmailbox_t*, uint32_t chat_id, uint32_t contact_id);
    380 int mrmailbox_get_chat_contact_count__ (mrmailbox_t*, uint32_t chat_id);
    381 int mrmailbox_group_explicitly_left__ (mrmailbox_t*, const char* grpid);
    382 void mrmailbox_set_group_explicitly_left__ (mrmailbox_t*, const char* grpid);
    383 size_t mrmailbox_get_real_msg_cnt__ (mrmailbox_t*); /* the number of messages assigned to real chat (!=deaddrop, !=trash) */
    384 size_t mrmailbox_get_deaddrop_msg_cnt__ (mrmailbox_t*);
    385 int mrmailbox_rfc724_mid_cnt__ (mrmailbox_t*, const char* rfc724_mid);
    386 int mrmailbox_rfc724_mid_exists__ (mrmailbox_t*, const char* rfc724_mid, char** ret_server_folder, uint32_t* ret_server_uid);
    387 void mrmailbox_update_server_uid__ (mrmailbox_t*, const char* rfc724_mid, const char* server_folder, uint32_t server_uid);
    388 void mrmailbox_update_msg_chat_id__ (mrmailbox_t*, uint32_t msg_id, uint32_t chat_id);
    389 void mrmailbox_update_msg_state__ (mrmailbox_t*, uint32_t msg_id, int state);
    390 void mrmailbox_delete_msg_on_imap (mrmailbox_t* mailbox, mrjob_t* job);
    391 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 */
    392 void mrmailbox_send_mdn (mrmailbox_t*, mrjob_t* job);
    393 void mrmailbox_markseen_msg_on_imap (mrmailbox_t* mailbox, mrjob_t* job);
    394 void mrmailbox_markseen_mdn_on_imap (mrmailbox_t* mailbox, mrjob_t* job);
    395 
    396 
    397 /* library private: end-to-end-encryption */
    398 #define MR_E2EE_DEFAULT_ENABLED 1
    399 #define MR_MDNS_DEFAULT_ENABLED 1
    400 
    401 typedef struct mrmailbox_e2ee_helper_t {
    402  int m_encryption_successfull;
    403  void* m_cdata_to_free;
    404 } mrmailbox_e2ee_helper_t;
    405 
    406 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*);
    407 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 */
    408 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! */
    409 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 */
    410 
    411 
    412 #ifdef __cplusplus
    413 } /* /extern "C" */
    414 #endif
    415 #endif /* __MRMAILBOX_H__ */
    int mrmailbox_add_address_book(mrmailbox_t *mailbox, const char *adr_book)
    Add a number of contacts.
    Definition: mrmailbox.c:4337
    +
    uint32_t mrmailbox_create_group_chat(mrmailbox_t *mailbox, const char *chat_name)
    Create a new group chat.
    Definition: mrmailbox.c:3625
    +
    uint32_t mrmailbox_create_contact(mrmailbox_t *mailbox, const char *name, const char *addr)
    Add a single contact.
    Definition: mrmailbox.c:4294
    +
    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:3247
    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:3646
    +
    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:3863
    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:3763
    +
    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:3980
    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:2109
    -
    int mrmailbox_delete_contact(mrmailbox_t *mailbox, uint32_t contact_id)
    Delete a contact.
    Definition: mrmailbox.c:4604
    +
    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:3462
    +
    int mrmailbox_delete_contact(mrmailbox_t *mailbox, uint32_t contact_id)
    Delete a contact.
    Definition: mrmailbox.c:4825
    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:5049
    +
    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:5270
    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:5191
    +
    void mrmailbox_delete_msgs(mrmailbox_t *mailbox, const uint32_t *msg_ids, int msg_cnt)
    Delete messages.
    Definition: mrmailbox.c:5412
    +
    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:3333
    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: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: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
    +
    mrarray_t * mrmailbox_get_blocked_contacts(mrmailbox_t *mailbox)
    Get blocked contacts.
    Definition: mrmailbox.c:4456
    +
    mrarray_t * mrmailbox_get_known_contacts(mrmailbox_t *mailbox, const char *query)
    Returns known and unblocked contacts.
    Definition: mrmailbox.c:4392
    +
    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:3895
    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
    +
    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:3377
    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: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: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
    +
    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:3510
    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:4385
    +
    void mrmailbox_block_contact(mrmailbox_t *mailbox, uint32_t contact_id, int new_blocking)
    Block or unblock a contact.
    Definition: mrmailbox.c:4606
    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
    @@ -135,32 +137,34 @@ 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: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
    +
    int mrmailbox_get_blocked_count(mrmailbox_t *mailbox)
    Get the number of blocked contacts.
    Definition: mrmailbox.c:4490
    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
    +
    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:3288
    +
    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:5017
    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:3557
    +
    int mrmailbox_set_chat_profile_image(mrmailbox_t *mailbox, uint32_t chat_id, const char *new_image)
    Set group profile image.
    Definition: mrmailbox.c:3774
    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: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
    +
    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:5184
    +
    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:5553
    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:2041
    -
    mrcontact_t * mrmailbox_get_contact(mrmailbox_t *mailbox, uint32_t contact_id)
    Get a single contact object.
    Definition: mrmailbox.c:4311
    +
    mrcontact_t * mrmailbox_get_contact(mrmailbox_t *mailbox, uint32_t contact_id)
    Get a single contact object.
    Definition: mrmailbox.c:4532
    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:4359
    +
    void mrmailbox_marknoticed_contact(mrmailbox_t *mailbox, uint32_t contact_id)
    Mark all messages send by the given contact as noticed.
    Definition: mrmailbox.c:4580
    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:3476
    +
    int mrmailbox_set_chat_name(mrmailbox_t *mailbox, uint32_t chat_id, const char *new_name)
    Set group name.
    Definition: mrmailbox.c:3693
    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:4476
    +
    char * mrmailbox_get_contact_encrinfo(mrmailbox_t *mailbox, uint32_t contact_id)
    Get encryption info for a contact.
    Definition: mrmailbox.c:4697
    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
    +
    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:3420
    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:4838
    +
    char * mrmailbox_get_msg_info(mrmailbox_t *mailbox, uint32_t msg_id)
    Get an informational text for a single message.
    Definition: mrmailbox.c:5059
    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 9c3af0de..a723eeb0 100644 --- a/docs/html/mrmsg_8h_source.html +++ b/docs/html/mrmsg_8h_source.html @@ -89,43 +89,35 @@ 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 
    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: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:236
    -
    mrmsg_t * mrmsg_new()
    Create new message object.
    Definition: mrmsg.c:41
    +
    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:184
    +
    int mrmsg_is_systemcmd(mrmsg_t *msg)
    Check if the message is a system command.
    Definition: mrmsg.c:627
    +
    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:548
    +
    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_get_state(mrmsg_t *msg)
    Get the state of a message.
    Definition: mrmsg.c:160
    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: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
    +
    mrpoortext_t * mrmsg_get_summary(mrmsg_t *msg, mrchat_t *chat)
    Get a summary for a message.
    Definition: mrmsg.c:506
    +
    mrpoortext_t * mrmsg_get_mediainfo(mrmsg_t *msg)
    Get real author and title.
    Definition: mrmsg.c:352
    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: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:151
    +
    void mrmsg_latefiling_mediasize(mrmsg_t *msg, int width, int height, int duration)
    Late filing information to a message.
    Definition: mrmsg.c:921
    +
    uint32_t m_to_id
    Contact ID of the recipient.
    Definition: mrmsg.h:62
    +
    uint32_t m_from_id
    Contact ID of the sender.
    Definition: mrmsg.h:55
    +
    int mrmsg_get_duration(mrmsg_t *msg)
    Get duration of audio or video.
    Definition: mrmsg.c:460
    +
    int mrmsg_is_starred(mrmsg_t *msg)
    Check if a message is starred.
    Definition: mrmsg.c:572
    +
    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
    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:901
    -
    mrparam_t * m_param
    Additional paramter for the message.
    Definition: mrmsg.h:113
    -
    char * m_text
    Message text.
    Definition: mrmsg.h:112
    +
    int mrmsg_is_increation(mrmsg_t *msg)
    Check if a message is still in creation.
    Definition: mrmsg.c:867
    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: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
    +
    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
    +
    int mrmsg_get_width(mrmsg_t *msg)
    Get width of image or video.
    Definition: mrmsg.c:413
    +
    time_t mrmsg_get_timestamp(mrmsg_t *msg)
    Get message time.
    Definition: mrmsg.c:178
    +
    int mrmsg_get_showpadlock(mrmsg_t *msg)
    Check if a padlock should be shown beside the message.
    Definition: mrmsg.c:478
    +
    char * mrmsg_get_filename(mrmsg_t *msg)
    Get base file name without path.
    Definition: mrmsg.c:246
    +
    char * mrmsg_get_text(mrmsg_t *msg)
    Get the text of the message.
    Definition: mrmsg.c:198
    +
    int mrmsg_is_forwarded(mrmsg_t *msg)
    Check if the message is a forwarded message.
    Definition: mrmsg.c:600
    +
    int mrmsg_get_height(mrmsg_t *msg)
    Get height of image or video.
    Definition: mrmsg.c:438
    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 ceedd1ec..339e0973 100644 --- a/docs/html/search/all_1.js +++ b/docs/html/search/all_1.js @@ -13,16 +13,13 @@ var searchData= ['m_5fid',['m_id',['../structmrchat__t.html#a1591431716413350eaffce0b588e4911',1,'mrchat_t::m_id()'],['../structmrcontact__t.html#ab2ee31297c327e04ed14673adbd49716',1,'mrcontact_t::m_id()'],['../structmrmsg__t.html#a793898c8da24c717dc2bb1d91faac801',1,'mrmsg_t::m_id()']]], ['m_5fmailbox',['m_mailbox',['../structmrarray__t.html#abd4dde487b63dc1bd2ff00c76854af4f',1,'mrarray_t::m_mailbox()'],['../structmrchat__t.html#abf3e1a34f567e168bc0597f9a544a50d',1,'mrchat_t::m_mailbox()'],['../structmrchatlist__t.html#a025d213cde2fa547b2f3cae4e1facbf7',1,'mrchatlist_t::m_mailbox()']]], ['m_5fname',['m_name',['../structmrchat__t.html#abbd344d8d361a1a4d14bfc9b5dc57140',1,'mrchat_t::m_name()'],['../structmrcontact__t.html#a48fba862b41f7da3b8c6193c0554654b',1,'mrcontact_t::m_name()']]], - ['m_5fparam',['m_param',['../structmrmsg__t.html#a2c31ec5b23e35fbe3ae3896eece09453',1,'mrmsg_t']]], - ['m_5fstarred',['m_starred',['../structmrmsg__t.html#a0570bbfc3add48dafb0ae70390b47adb',1,'mrmsg_t']]], - ['m_5fstate',['m_state',['../structmrmsg__t.html#aca59d28054d3e15b4fe6ca74073d91f4',1,'mrmsg_t::m_state()'],['../structmrpoortext__t.html#afbf2ae7473784db66127e63657e04f60',1,'mrpoortext_t::m_state()']]], - ['m_5ftext',['m_text',['../structmrmsg__t.html#ae54dcd4036371597d7f8bbd75303527a',1,'mrmsg_t']]], + ['m_5fstate',['m_state',['../structmrpoortext__t.html#afbf2ae7473784db66127e63657e04f60',1,'mrpoortext_t']]], ['m_5ftext1',['m_text1',['../structmrpoortext__t.html#af3b56661ccf1c783f397c15c310cf36f',1,'mrpoortext_t']]], ['m_5ftext1_5fmeaning',['m_text1_meaning',['../structmrpoortext__t.html#a39469bd76b12fc8da2c3341433cab893',1,'mrpoortext_t']]], ['m_5ftext2',['m_text2',['../structmrpoortext__t.html#a54e10365f38dddd070a2ab68f4177331',1,'mrpoortext_t']]], - ['m_5ftimestamp',['m_timestamp',['../structmrmsg__t.html#aba09cb77cdabd1e2b2e6262d25388801',1,'mrmsg_t::m_timestamp()'],['../structmrpoortext__t.html#a372913d9a39616e48722ea04c759f887',1,'mrpoortext_t::m_timestamp()']]], + ['m_5ftimestamp',['m_timestamp',['../structmrpoortext__t.html#a372913d9a39616e48722ea04c759f887',1,'mrpoortext_t']]], ['m_5fto_5fid',['m_to_id',['../structmrmsg__t.html#ad549fc02587ba284fda2bbecd162b16a',1,'mrmsg_t']]], - ['m_5ftype',['m_type',['../structmrchat__t.html#a568c4e6fb9633ffe9a76428db16e0201',1,'mrchat_t::m_type()'],['../structmrmsg__t.html#a3896e269c90cbf0f563ab0848fb44c65',1,'mrmsg_t::m_type()']]], + ['m_5ftype',['m_type',['../structmrchat__t.html#a568c4e6fb9633ffe9a76428db16e0201',1,'mrchat_t']]], ['m_5fuserdata',['m_userdata',['../structmrmailbox__t.html#a6c557153209e128b69301246dbf9e230',1,'mrmailbox_t']]], ['mr_5fevent_5fchat_5fmodified',['MR_EVENT_CHAT_MODIFIED',['../mrevent_8h.html#a5ac741b81ec97628f44795600c0e4d4c',1,'mrevent.h']]], ['mr_5fevent_5fconfigure_5fprogress',['MR_EVENT_CONFIGURE_PROGRESS',['../mrevent_8h.html#abb0881d4c7c887b8f371cedc471846b5',1,'mrevent.h']]], @@ -118,9 +115,13 @@ var searchData= ['mrmailbox_5fopen',['mrmailbox_open',['../structmrmailbox__t.html#ae4c9c9f9ce4b3de82b3ce7fc582cbc5b',1,'mrmailbox_t']]], ['mrmailbox_5fremove_5fcontact_5ffrom_5fchat',['mrmailbox_remove_contact_from_chat',['../structmrmailbox__t.html#a40226d401548b002a62648ea054ac635',1,'mrmailbox_t']]], ['mrmailbox_5fsearch_5fmsgs',['mrmailbox_search_msgs',['../structmrmailbox__t.html#abbb08c91369ff2fedc8575f2e1f01e56',1,'mrmailbox_t']]], - ['mrmailbox_5fsend_5fmsg',['mrmailbox_send_msg',['../structmrmailbox__t.html#a88ef3066cec30fe26f61f273b233d90c',1,'mrmailbox_t']]], + ['mrmailbox_5fsend_5faudio_5fmsg',['mrmailbox_send_audio_msg',['../structmrmailbox__t.html#ae24df813f179fdab160f94c583c63401',1,'mrmailbox_t']]], + ['mrmailbox_5fsend_5ffile_5fmsg',['mrmailbox_send_file_msg',['../structmrmailbox__t.html#a7f39fa026b22360e282c9138e5af4ce9',1,'mrmailbox_t']]], + ['mrmailbox_5fsend_5fimage_5fmsg',['mrmailbox_send_image_msg',['../structmrmailbox__t.html#a2fdedd72b9f792463e4af173f21bb11c',1,'mrmailbox_t']]], ['mrmailbox_5fsend_5ftext_5fmsg',['mrmailbox_send_text_msg',['../structmrmailbox__t.html#a3f9ac5fb9ff2dcbaafdddb5d955ac39b',1,'mrmailbox_t']]], ['mrmailbox_5fsend_5fvcard_5fmsg',['mrmailbox_send_vcard_msg',['../structmrmailbox__t.html#a88e7fe7faa3576c086b6d3e0ab825892',1,'mrmailbox_t']]], + ['mrmailbox_5fsend_5fvideo_5fmsg',['mrmailbox_send_video_msg',['../structmrmailbox__t.html#a8c0dc35fd9696d35f6a8301501f37c5a',1,'mrmailbox_t']]], + ['mrmailbox_5fsend_5fvoice_5fmsg',['mrmailbox_send_voice_msg',['../structmrmailbox__t.html#a42935531261ba3ed8afd82cf39fe928a',1,'mrmailbox_t']]], ['mrmailbox_5fset_5fchat_5fname',['mrmailbox_set_chat_name',['../structmrmailbox__t.html#a8772e9bb55b02299f65ebd8bcc682bb1',1,'mrmailbox_t']]], ['mrmailbox_5fset_5fchat_5fprofile_5fimage',['mrmailbox_set_chat_profile_image',['../structmrmailbox__t.html#a08c527170681c949ddd6931a004fdd5f',1,'mrmailbox_t']]], ['mrmailbox_5fset_5fconfig',['mrmailbox_set_config',['../structmrmailbox__t.html#a19b3e9f5209bc326fc77f3944522e8ad',1,'mrmailbox_t']]], @@ -130,7 +131,6 @@ var searchData= ['mrmailbox_5ft',['mrmailbox_t',['../structmrmailbox__t.html',1,'']]], ['mrmailbox_5funref',['mrmailbox_unref',['../structmrmailbox__t.html#a825cec4a85da05335674eae221d51374',1,'mrmailbox_t']]], ['mrmailboxcb_5ft',['mrmailboxcb_t',['../structmrmailbox__t.html#a957f0bbae60f389bac40acf42b68b134',1,'mrmailbox_t']]], - ['mrmsg_5fempty',['mrmsg_empty',['../structmrmsg__t.html#a57d94b55fc918b27874b9194d6c35388',1,'mrmsg_t']]], ['mrmsg_5fget_5fduration',['mrmsg_get_duration',['../structmrmsg__t.html#aa180c0fd4c9cdd58cc47006022ebc1e0',1,'mrmsg_t']]], ['mrmsg_5fget_5ffile',['mrmsg_get_file',['../structmrmsg__t.html#a2544769c77af5447546fcf5fc95c64f7',1,'mrmsg_t']]], ['mrmsg_5fget_5ffilebytes',['mrmsg_get_filebytes',['../structmrmsg__t.html#afd11616dcf572662561829c0f48ca713',1,'mrmsg_t']]], @@ -143,16 +143,14 @@ var searchData= ['mrmsg_5fget_5fsummary',['mrmsg_get_summary',['../structmrmsg__t.html#afc3d94448ada0ad7142cf168cab1462e',1,'mrmsg_t']]], ['mrmsg_5fget_5fsummarytext',['mrmsg_get_summarytext',['../structmrmsg__t.html#a8c8c1f342f01439ae40c5cf37532387e',1,'mrmsg_t']]], ['mrmsg_5fget_5ftext',['mrmsg_get_text',['../structmrmsg__t.html#ae549e58d9ae2f73ad76bd27636b43982',1,'mrmsg_t']]], + ['mrmsg_5fget_5ftimestamp',['mrmsg_get_timestamp',['../structmrmsg__t.html#af5bf52ee1adbc55c9c9d4699afee87fb',1,'mrmsg_t']]], ['mrmsg_5fget_5ftype',['mrmsg_get_type',['../structmrmsg__t.html#a705454903b36ded8c3cd43a2044de60a',1,'mrmsg_t']]], ['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_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',['../structmrmailbox__t.html#a9e5dc81d4e814284b465ad23abbfb6cb',1,'mrmailbox_t']]], - ['mrmsg_5fnew',['mrmsg_new',['../structmrmsg__t.html#a80f470eb34af414ff28e7d3b3c715b48',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']]], + ['mrmsg_5flatefiling_5fmediasize',['mrmsg_latefiling_mediasize',['../structmrmsg__t.html#a9e5dc81d4e814284b465ad23abbfb6cb',1,'mrmsg_t']]], ['mrmsg_5ft',['mrmsg_t',['../structmrmsg__t.html',1,'']]], ['mrmsg_5funref',['mrmsg_unref',['../structmrmsg__t.html#aa33212e41efff643aa7290753f3d9b02',1,'mrmsg_t']]], ['mrparam_5fempty',['mrparam_empty',['../structmrparam__t.html#a88397aa66e74bcdc61c8376c8e9a761b',1,'mrparam_t']]], diff --git a/docs/html/search/functions_0.js b/docs/html/search/functions_0.js index 5d377939..2e052490 100644 --- a/docs/html/search/functions_0.js +++ b/docs/html/search/functions_0.js @@ -71,9 +71,13 @@ var searchData= ['mrmailbox_5fopen',['mrmailbox_open',['../structmrmailbox__t.html#ae4c9c9f9ce4b3de82b3ce7fc582cbc5b',1,'mrmailbox_t']]], ['mrmailbox_5fremove_5fcontact_5ffrom_5fchat',['mrmailbox_remove_contact_from_chat',['../structmrmailbox__t.html#a40226d401548b002a62648ea054ac635',1,'mrmailbox_t']]], ['mrmailbox_5fsearch_5fmsgs',['mrmailbox_search_msgs',['../structmrmailbox__t.html#abbb08c91369ff2fedc8575f2e1f01e56',1,'mrmailbox_t']]], - ['mrmailbox_5fsend_5fmsg',['mrmailbox_send_msg',['../structmrmailbox__t.html#a88ef3066cec30fe26f61f273b233d90c',1,'mrmailbox_t']]], + ['mrmailbox_5fsend_5faudio_5fmsg',['mrmailbox_send_audio_msg',['../structmrmailbox__t.html#ae24df813f179fdab160f94c583c63401',1,'mrmailbox_t']]], + ['mrmailbox_5fsend_5ffile_5fmsg',['mrmailbox_send_file_msg',['../structmrmailbox__t.html#a7f39fa026b22360e282c9138e5af4ce9',1,'mrmailbox_t']]], + ['mrmailbox_5fsend_5fimage_5fmsg',['mrmailbox_send_image_msg',['../structmrmailbox__t.html#a2fdedd72b9f792463e4af173f21bb11c',1,'mrmailbox_t']]], ['mrmailbox_5fsend_5ftext_5fmsg',['mrmailbox_send_text_msg',['../structmrmailbox__t.html#a3f9ac5fb9ff2dcbaafdddb5d955ac39b',1,'mrmailbox_t']]], ['mrmailbox_5fsend_5fvcard_5fmsg',['mrmailbox_send_vcard_msg',['../structmrmailbox__t.html#a88e7fe7faa3576c086b6d3e0ab825892',1,'mrmailbox_t']]], + ['mrmailbox_5fsend_5fvideo_5fmsg',['mrmailbox_send_video_msg',['../structmrmailbox__t.html#a8c0dc35fd9696d35f6a8301501f37c5a',1,'mrmailbox_t']]], + ['mrmailbox_5fsend_5fvoice_5fmsg',['mrmailbox_send_voice_msg',['../structmrmailbox__t.html#a42935531261ba3ed8afd82cf39fe928a',1,'mrmailbox_t']]], ['mrmailbox_5fset_5fchat_5fname',['mrmailbox_set_chat_name',['../structmrmailbox__t.html#a8772e9bb55b02299f65ebd8bcc682bb1',1,'mrmailbox_t']]], ['mrmailbox_5fset_5fchat_5fprofile_5fimage',['mrmailbox_set_chat_profile_image',['../structmrmailbox__t.html#a08c527170681c949ddd6931a004fdd5f',1,'mrmailbox_t']]], ['mrmailbox_5fset_5fconfig',['mrmailbox_set_config',['../structmrmailbox__t.html#a19b3e9f5209bc326fc77f3944522e8ad',1,'mrmailbox_t']]], @@ -81,7 +85,6 @@ var searchData= ['mrmailbox_5fset_5fdraft',['mrmailbox_set_draft',['../structmrmailbox__t.html#af50446c1a5e504d27fe29de9e3b8edc3',1,'mrmailbox_t']]], ['mrmailbox_5fstar_5fmsgs',['mrmailbox_star_msgs',['../structmrmailbox__t.html#a8ed1c3bd08cd6515abf6046ebad9cafc',1,'mrmailbox_t']]], ['mrmailbox_5funref',['mrmailbox_unref',['../structmrmailbox__t.html#a825cec4a85da05335674eae221d51374',1,'mrmailbox_t']]], - ['mrmsg_5fempty',['mrmsg_empty',['../structmrmsg__t.html#a57d94b55fc918b27874b9194d6c35388',1,'mrmsg_t']]], ['mrmsg_5fget_5fduration',['mrmsg_get_duration',['../structmrmsg__t.html#aa180c0fd4c9cdd58cc47006022ebc1e0',1,'mrmsg_t']]], ['mrmsg_5fget_5ffile',['mrmsg_get_file',['../structmrmsg__t.html#a2544769c77af5447546fcf5fc95c64f7',1,'mrmsg_t']]], ['mrmsg_5fget_5ffilebytes',['mrmsg_get_filebytes',['../structmrmsg__t.html#afd11616dcf572662561829c0f48ca713',1,'mrmsg_t']]], @@ -94,16 +97,14 @@ var searchData= ['mrmsg_5fget_5fsummary',['mrmsg_get_summary',['../structmrmsg__t.html#afc3d94448ada0ad7142cf168cab1462e',1,'mrmsg_t']]], ['mrmsg_5fget_5fsummarytext',['mrmsg_get_summarytext',['../structmrmsg__t.html#a8c8c1f342f01439ae40c5cf37532387e',1,'mrmsg_t']]], ['mrmsg_5fget_5ftext',['mrmsg_get_text',['../structmrmsg__t.html#ae549e58d9ae2f73ad76bd27636b43982',1,'mrmsg_t']]], + ['mrmsg_5fget_5ftimestamp',['mrmsg_get_timestamp',['../structmrmsg__t.html#af5bf52ee1adbc55c9c9d4699afee87fb',1,'mrmsg_t']]], ['mrmsg_5fget_5ftype',['mrmsg_get_type',['../structmrmsg__t.html#a705454903b36ded8c3cd43a2044de60a',1,'mrmsg_t']]], ['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_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',['../structmrmailbox__t.html#a9e5dc81d4e814284b465ad23abbfb6cb',1,'mrmailbox_t']]], - ['mrmsg_5fnew',['mrmsg_new',['../structmrmsg__t.html#a80f470eb34af414ff28e7d3b3c715b48',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']]], + ['mrmsg_5flatefiling_5fmediasize',['mrmsg_latefiling_mediasize',['../structmrmsg__t.html#a9e5dc81d4e814284b465ad23abbfb6cb',1,'mrmsg_t']]], ['mrmsg_5funref',['mrmsg_unref',['../structmrmsg__t.html#aa33212e41efff643aa7290753f3d9b02',1,'mrmsg_t']]], ['mrparam_5fempty',['mrparam_empty',['../structmrparam__t.html#a88397aa66e74bcdc61c8376c8e9a761b',1,'mrparam_t']]], ['mrparam_5fexists',['mrparam_exists',['../structmrparam__t.html#a0a9d3768d128dce0088b089f66fafb68',1,'mrparam_t']]], diff --git a/docs/html/search/variables_0.js b/docs/html/search/variables_0.js index d0668aee..fb7ffbe0 100644 --- a/docs/html/search/variables_0.js +++ b/docs/html/search/variables_0.js @@ -13,15 +13,12 @@ var searchData= ['m_5fid',['m_id',['../structmrchat__t.html#a1591431716413350eaffce0b588e4911',1,'mrchat_t::m_id()'],['../structmrcontact__t.html#ab2ee31297c327e04ed14673adbd49716',1,'mrcontact_t::m_id()'],['../structmrmsg__t.html#a793898c8da24c717dc2bb1d91faac801',1,'mrmsg_t::m_id()']]], ['m_5fmailbox',['m_mailbox',['../structmrarray__t.html#abd4dde487b63dc1bd2ff00c76854af4f',1,'mrarray_t::m_mailbox()'],['../structmrchat__t.html#abf3e1a34f567e168bc0597f9a544a50d',1,'mrchat_t::m_mailbox()'],['../structmrchatlist__t.html#a025d213cde2fa547b2f3cae4e1facbf7',1,'mrchatlist_t::m_mailbox()']]], ['m_5fname',['m_name',['../structmrchat__t.html#abbd344d8d361a1a4d14bfc9b5dc57140',1,'mrchat_t::m_name()'],['../structmrcontact__t.html#a48fba862b41f7da3b8c6193c0554654b',1,'mrcontact_t::m_name()']]], - ['m_5fparam',['m_param',['../structmrmsg__t.html#a2c31ec5b23e35fbe3ae3896eece09453',1,'mrmsg_t']]], - ['m_5fstarred',['m_starred',['../structmrmsg__t.html#a0570bbfc3add48dafb0ae70390b47adb',1,'mrmsg_t']]], - ['m_5fstate',['m_state',['../structmrmsg__t.html#aca59d28054d3e15b4fe6ca74073d91f4',1,'mrmsg_t::m_state()'],['../structmrpoortext__t.html#afbf2ae7473784db66127e63657e04f60',1,'mrpoortext_t::m_state()']]], - ['m_5ftext',['m_text',['../structmrmsg__t.html#ae54dcd4036371597d7f8bbd75303527a',1,'mrmsg_t']]], + ['m_5fstate',['m_state',['../structmrpoortext__t.html#afbf2ae7473784db66127e63657e04f60',1,'mrpoortext_t']]], ['m_5ftext1',['m_text1',['../structmrpoortext__t.html#af3b56661ccf1c783f397c15c310cf36f',1,'mrpoortext_t']]], ['m_5ftext1_5fmeaning',['m_text1_meaning',['../structmrpoortext__t.html#a39469bd76b12fc8da2c3341433cab893',1,'mrpoortext_t']]], ['m_5ftext2',['m_text2',['../structmrpoortext__t.html#a54e10365f38dddd070a2ab68f4177331',1,'mrpoortext_t']]], - ['m_5ftimestamp',['m_timestamp',['../structmrmsg__t.html#aba09cb77cdabd1e2b2e6262d25388801',1,'mrmsg_t::m_timestamp()'],['../structmrpoortext__t.html#a372913d9a39616e48722ea04c759f887',1,'mrpoortext_t::m_timestamp()']]], + ['m_5ftimestamp',['m_timestamp',['../structmrpoortext__t.html#a372913d9a39616e48722ea04c759f887',1,'mrpoortext_t']]], ['m_5fto_5fid',['m_to_id',['../structmrmsg__t.html#ad549fc02587ba284fda2bbecd162b16a',1,'mrmsg_t']]], - ['m_5ftype',['m_type',['../structmrchat__t.html#a568c4e6fb9633ffe9a76428db16e0201',1,'mrchat_t::m_type()'],['../structmrmsg__t.html#a3896e269c90cbf0f563ab0848fb44c65',1,'mrmsg_t::m_type()']]], + ['m_5ftype',['m_type',['../structmrchat__t.html#a568c4e6fb9633ffe9a76428db16e0201',1,'mrchat_t']]], ['m_5fuserdata',['m_userdata',['../structmrmailbox__t.html#a6c557153209e128b69301246dbf9e230',1,'mrmailbox_t']]] ]; diff --git a/docs/html/structmrchat__t.html b/docs/html/structmrchat__t.html index 35d5cea8..e96a4966 100644 --- a/docs/html/structmrchat__t.html +++ b/docs/html/structmrchat__t.html @@ -179,7 +179,7 @@ Public Attributes

    Check if a chat is still unpromoted.

    Chats are unpromoted until the first message is sent. With unpromoted chats, members can be sent, settings can be modified without the need of special status messages being sent.

    -

    After the creation with mrmailbox_create_group_chat() the chat is usuall unpromoted until the first call to mrmailbox_send_msg() or mrmailbox_send_text_msg().

    +

    After the creation with mrmailbox_create_group_chat() the chat is usuall unpromoted until the first call to mrmailbox_send_msg() or mrmailbox_send_text_msg().

    Parameters
    data1chat_id
    diff --git a/docs/html/structmrmailbox__t-members.html b/docs/html/structmrmailbox__t-members.html index 1adc4ec5..d0dd550a 100644 --- a/docs/html/structmrmailbox__t-members.html +++ b/docs/html/structmrmailbox__t-members.html @@ -143,9 +143,13 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); - + + + + + @@ -154,7 +158,6 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); -
    chatThe chat object.
    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_msg(mrmailbox_t *mailbox, uint32_t chat_id, mrmsg_t *msg)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_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
    -

    Send a simple text message to the given chat.

    +

    Send a simple text message a given chat.

    Sends the event MR_EVENT_MSGS_CHANGED on succcess. However, this does not imply, the message really reached the recipient - sending may be delayed eg. due to network problems. However, from your view, you're done with the message. Sooner or later it will find its way.

    -

    To send messages of other types, see mrmailbox_send_msg().

    +

    See also mrmailbox_send_image_msg().

    Parameters
    - - + +
    mailboxThe mailbox object as returned from mrmailbox_new().
    chat_idChat ID to send the message to.
    mailboxThe mailbox object as returned from mrmailbox_new().
    chat_idChat ID to send the text message to.
    text_to_sendText to send to the chat defined by the chat ID.
    Returns
    The ID of the message that is about being sent.
    +
    + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    uint32_t mrmailbox_send_image_msg (mrmailbox_tmailbox,
    uint32_t chat_id,
    const char * file,
    const char * filemime,
    int width,
    int height 
    )
    +
    + +

    Send an image to a chat.

    +

    Sends the event MR_EVENT_MSGS_CHANGED on succcess. However, this does not imply, the message really reached the recipient - sending may be delayed eg. due to network problems. However, from your view, you're done with the message. Sooner or later it will find its way.

    +

    See also mrmailbox_send_text_msg().

    +
    Parameters
    + + + + + + + +
    mailboxThe mailbox object as returned from mrmailbox_new().
    chat_idChat ID to send the image to.
    fileFull path of the image file to send. The core may make a copy of the file.
    filemimeMime type of the file to send. NULL if you don't know or don't care.
    widthWidth in pixel of the file. 0 if you don't know or don't care.
    heightWidth in pixel of the file. 0 if you don't know or don't care.
    +
    +
    +
    Returns
    The ID of the message that is about being sent.
    + +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    uint32_t mrmailbox_send_video_msg (mrmailbox_tmailbox,
    uint32_t chat_id,
    const char * file,
    const char * filemime,
    int width,
    int height,
    int duration 
    )
    +
    + +

    Send an video to a chat.

    +

    Sends the event MR_EVENT_MSGS_CHANGED on succcess. However, this does not imply, the message really reached the recipient - sending may be delayed eg. due to network problems. However, from your view, you're done with the message. Sooner or later it will find its way.

    +

    See also mrmailbox_send_image_msg().

    +
    Parameters
    + + + + + + + + +
    mailboxThe mailbox object as returned from mrmailbox_new().
    chat_idChat ID to send the video to.
    fileFull path of the video file to send. The core may make a copy of the file.
    filemimeMime type of the file to send. NULL if you don't know or don't care.
    widthWidth in video of the file, if known. 0 if you don't know or don't care.
    heightWidth in video of the file, if known. 0 if you don't know or don't care.
    durationLength of the video in milliseconds. 0 if you don't know or don't care.
    +
    +
    +
    Returns
    The ID of the message that is about being sent.
    + +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    uint32_t mrmailbox_send_voice_msg (mrmailbox_tmailbox,
    uint32_t chat_id,
    const char * file,
    const char * filemime,
    int duration 
    )
    +
    + +

    Send a voice message to a chat.

    +

    Voice messages are messages just recorded though the device microphone. For sending music or other audio data, use mrmailbox_send_audio_msg().

    +

    Sends the event MR_EVENT_MSGS_CHANGED on succcess. However, this does not imply, the message really reached the recipient - sending may be delayed eg. due to network problems. However, from your view, you're done with the message. Sooner or later it will find its way.

    +
    Parameters
    + + + + + + +
    mailboxThe mailbox object as returned from mrmailbox_new().
    chat_idChat ID to send the voice message to.
    fileFull path of the file to send. The core may make a copy of the file.
    filemimeMime type of the file to send. NULL if you don't know or don't care.
    durationLength of the voice message in milliseconds. 0 if you don't know or don't care.
    +
    +
    +
    Returns
    The ID of the message that is about being sent.
    + +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    uint32_t mrmailbox_send_audio_msg (mrmailbox_tmailbox,
    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.

    +

    Audio messages are eg. music tracks. For voice messages just recorded though the device microphone, use mrmailbox_send_voice_msg().

    +

    Sends the event MR_EVENT_MSGS_CHANGED on succcess. However, this does not imply, the message really reached the recipient - sending may be delayed eg. due to network problems. However, from your view, you're done with the message. Sooner or later it will find its way.

    +
    Parameters
    + + + + + + + + +
    mailboxThe mailbox object as returned from mrmailbox_new().
    chat_idChat ID to send the audio to.
    fileFull path of the file to send. The core may make a copy of the file.
    filemimeMime type of the file to send. NULL if you don't know or don't care.
    durationLength of the audio in milliseconds. 0 if you don't know or don't care.
    authorAuthor or artist of the file. NULL if you don't know or don't care.
    tracknameTrackname or title of the file. NULL if you don't know or don't care.
    +
    +
    +
    Returns
    The ID of the message that is about being sent.
    + +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    uint32_t mrmailbox_send_file_msg (mrmailbox_tmailbox,
    uint32_t chat_id,
    const char * file,
    const char * filemime 
    )
    +
    + +

    Send a document to a chat.

    +

    Use this function to send any document or file to a chat.

    +

    Sends the event MR_EVENT_MSGS_CHANGED on succcess. However, this does not imply, the message really reached the recipient - sending may be delayed eg. due to network problems. However, from your view, you're done with the message. Sooner or later it will find its way.

    +
    Parameters
    + + + + + +
    mailboxThe mailbox object as returned from mrmailbox_new().
    chat_idChat ID to send the document to.
    fileFull path of the file to send. The core may make a copy of the file.
    filemimeMime type of the file to send. NULL if you don't know or don't care.
    +
    +
    +
    Returns
    The ID of the message that is about being sent.
    +
    @@ -1528,7 +1860,8 @@ Public Attributes

    Send foreign contact data to a chat.

    Sends the name and the email address of another contact to a chat. The contact this may or may not be a member of the chat.

    Typically used to share a contact to another member or to a group of members.

    -

    Internally, the function just creates an appropriate text message and sends it using mrmailbox_send_text_msg().

    +

    Internally, the function just creates an appropriate text message and sends it using mrmailbox_send_text_msg().

    +

    Future implementations may also send the key of the user though gossip; currently, this is not done.

    NB: The "vcard" in the function name is just an abbreviation of "visiting card" and is not related to the VCARD data format.

    Parameters
    @@ -1540,53 +1873,6 @@ Public Attributes
    Returns
    Returns the ID of the message sent.
    - - - -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - -
    uint32_t mrmailbox_send_msg (mrmailbox_tmailbox,
    uint32_t chat_id,
    mrmsg_tmsg 
    )
    -
    - -

    Send a message of any type to a chat.

    -

    The given message object is not unref'd by the function but some fields are set up.

    -

    Sends the event MR_EVENT_MSGS_CHANGED on succcess. However, this does not imply, the message really reached the recipient - sending may be delayed eg. due to network problems. However, from your view, you're done with the message. Sooner or later it will find its way.

    -

    To send a simple text message, you can also use mrmailbox_send_text_msg() which is easier to use.

    -
    Parameters
    - - - - -
    mailboxThe mailbox object as returned from mrmailbox_new().
    chat_idChat ID to send the message to.
    msgMessage object to send to the chat defined by the chat ID. The function does not take ownership of the object, so you have to free it using mrmsg_unref() as usual.
    -
    -
    -
    Returns
    The ID of the message that is about being sent.
    -

    Examples:

    -
    mrmsg_t* msg1 = mrmsg_new();
    mrmsg_set_type(msg1, MR_MSG_TEXT);
    mrmsg_set_text(msg1, "Hi there!");
    mrmailbox_send_msg(mailbox, chat_id, msg1); // send a simple text message
    mrmsg_unref(msg1);
    mrmsg_t* msg2 = mrmsg_new();
    mrmsg_set_type(msg2, MR_MSG_IMAGE);
    mrmsg_set_file(msg2, "/path/to/image.jpg");
    mrmailbox_send_msg(mailbox, chat_id, msg2); // send a simple text message
    mrmsg_unref(msg1);
    @@ -1884,7 +2170,7 @@ Public Attributes

    Add a single contact.

    We assume, the contact name, if any, is entered by the user and is used "as is" therefore, mrcontact_normalize_name() is not called for the name.

    -

    To add a number of contacts, see mrmailbox_add_address_book()

    +

    To add a number of contacts, see mrmailbox_add_address_book() which is much faster for adding a bunch of addresses.

    Parameters
    @@ -1923,7 +2209,8 @@ Public Attributes

    Add a number of contacts.

    Typically used to add the whole address book from the OS. As names here are typically not well formatted, we call mrcontact_normalize_name() for each name given.

    -

    To add a single contact entered by the user, you should prefer mrmailbox_create_contact()

    +

    To add a single contact entered by the user, you should prefer mrmailbox_create_contact(), however, for adding a bunch of addresses, this function is much faster.

    +

    The function takes are of not overwriting names manually added or edited by mrmailbox_create_contact().

    Parameters
    mailboxThe mailbox object as created by mrmailbox_new().
    @@ -2710,60 +2997,6 @@ Public Attributes
    Returns
    Setup code, must be free()'d after usage.
    - - - -
    -
    -
    mailboxthe mailbox object as created by mrmailbox_new().
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    void mrmsg_latefiling_mediasize (mrmsg_tmsg,
    int width,
    int height,
    int duration 
    )
    -
    - -

    Late filing information to a message.

    -

    Sometimes, the core cannot find out the width, the height or the duration of an image, an audio or a video.

    -

    If, in these cases, the frontend can provide the information, it can save them together with the message object for later usage.

    -

    This function should only be used if mrmsg_get_width(), mrmsg_get_height() or mrmsg_get_duration() do not provide the expected values.

    -

    To get the stored values later, use mrmsg_get_width(), mrmsg_get_height() or mrmsg_get_duration().

    -
    Parameters
    - - - - - -
    msgThe message object.
    widthThe new width to store in the message object. 0 if you do not want to change it.
    heightThe new height to store in the message object. 0 if you do not want to change it.
    durationThe new duration to store in the message object. 0 if you do not want to change it.
    -
    -
    -
    Returns
    None.
    -

    Member Data Documentation

    @@ -2817,7 +3050,6 @@ Public Attributes
  • /home/bpetersen/projects/deltachat-core/src/mrmailbox.c
  • /home/bpetersen/projects/deltachat-core/src/mrmailbox_configure.c
  • /home/bpetersen/projects/deltachat-core/src/mrmailbox_imex.c
  • -
  • /home/bpetersen/projects/deltachat-core/src/mrmsg.c
  • diff --git a/docs/html/structmrmsg__t-members.html b/docs/html/structmrmsg__t-members.html index fc3274a9..61fe098c 100644 --- a/docs/html/structmrmsg__t-members.html +++ b/docs/html/structmrmsg__t-members.html @@ -91,35 +91,27 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); m_chat_idmrmsg_t m_from_idmrmsg_t m_idmrmsg_t - m_parammrmsg_t - m_starredmrmsg_t - m_statemrmsg_t - m_textmrmsg_t - m_timestampmrmsg_t - m_to_idmrmsg_t - m_typemrmsg_t - mrmsg_empty(mrmsg_t *msg)mrmsg_t - mrmsg_get_duration(mrmsg_t *msg)mrmsg_t - mrmsg_get_file(mrmsg_t *msg)mrmsg_t - mrmsg_get_filebytes(mrmsg_t *msg)mrmsg_t - mrmsg_get_filemime(mrmsg_t *msg)mrmsg_t - mrmsg_get_filename(mrmsg_t *msg)mrmsg_t - mrmsg_get_height(mrmsg_t *msg)mrmsg_t - mrmsg_get_mediainfo(mrmsg_t *msg)mrmsg_t - mrmsg_get_showpadlock(mrmsg_t *msg)mrmsg_t - mrmsg_get_state(mrmsg_t *msg)mrmsg_t - mrmsg_get_summary(mrmsg_t *msg, mrchat_t *chat)mrmsg_t - mrmsg_get_summarytext(mrmsg_t *msg, int approx_characters)mrmsg_t - mrmsg_get_text(mrmsg_t *msg)mrmsg_t + m_to_idmrmsg_t + mrmsg_get_duration(mrmsg_t *msg)mrmsg_t + mrmsg_get_file(mrmsg_t *msg)mrmsg_t + mrmsg_get_filebytes(mrmsg_t *msg)mrmsg_t + mrmsg_get_filemime(mrmsg_t *msg)mrmsg_t + mrmsg_get_filename(mrmsg_t *msg)mrmsg_t + mrmsg_get_height(mrmsg_t *msg)mrmsg_t + mrmsg_get_mediainfo(mrmsg_t *msg)mrmsg_t + mrmsg_get_showpadlock(mrmsg_t *msg)mrmsg_t + mrmsg_get_state(mrmsg_t *msg)mrmsg_t + mrmsg_get_summary(mrmsg_t *msg, mrchat_t *chat)mrmsg_t + mrmsg_get_summarytext(mrmsg_t *msg, int approx_characters)mrmsg_t + mrmsg_get_text(mrmsg_t *msg)mrmsg_t + mrmsg_get_timestamp(mrmsg_t *msg)mrmsg_t mrmsg_get_type(mrmsg_t *msg)mrmsg_t mrmsg_get_width(mrmsg_t *msg)mrmsg_t mrmsg_is_forwarded(mrmsg_t *msg)mrmsg_t mrmsg_is_increation(mrmsg_t *msg)mrmsg_t - mrmsg_is_systemcmd(mrmsg_t *msg)mrmsg_t - mrmsg_new()mrmsg_t - mrmsg_set_file(mrmsg_t *msg, const char *file)mrmsg_t - mrmsg_set_text(mrmsg_t *msg, const char *text)mrmsg_t - mrmsg_set_type(mrmsg_t *msg, int type)mrmsg_t + mrmsg_is_starred(mrmsg_t *msg)mrmsg_t + mrmsg_is_systemcmd(mrmsg_t *msg)mrmsg_t + mrmsg_latefiling_mediasize(mrmsg_t *msg, int width, int height, int duration)mrmsg_t mrmsg_unref(mrmsg_t *msg)mrmsg_t diff --git a/docs/html/structmrmsg__t.html b/docs/html/structmrmsg__t.html index c9787dfc..d7d44f3f 100644 --- a/docs/html/structmrmsg__t.html +++ b/docs/html/structmrmsg__t.html @@ -97,30 +97,18 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); - - - - - - - - - - - - - - - + + + @@ -157,6 +145,9 @@ Public Member Functions + + + @@ -166,6 +157,9 @@ Public Member Functions + + +

    Public Member Functions

    mrmsg_tmrmsg_new ()
     Create new message object. More...
     
    void mrmsg_unref (mrmsg_t *msg)
     Free a message object. More...
     
    void mrmsg_empty (mrmsg_t *msg)
     Empty a message object. More...
     
    void mrmsg_set_type (mrmsg_t *msg, int type)
     Set the type of a message. More...
     
    void mrmsg_set_text (mrmsg_t *msg, const char *text)
     Set the text of a message object. More...
     
    void mrmsg_set_file (mrmsg_t *msg, const char *file)
     Set the file belonging to a message. More...
     
    int mrmsg_get_type (mrmsg_t *msg)
     Get the type of the message. More...
     
    int mrmsg_get_state (mrmsg_t *msg)
     Get the state of a message. More...
     
    time_t mrmsg_get_timestamp (mrmsg_t *msg)
     Get message time. More...
     
    char * mrmsg_get_text (mrmsg_t *msg)
     Get the text of the message. More...
     
    char * mrmsg_get_summarytext (mrmsg_t *msg, int approx_characters)
     Get a message summary as a single line of text. More...
     
    int mrmsg_is_starred (mrmsg_t *msg)
     Check if a message is starred. More...
     
    int mrmsg_is_forwarded (mrmsg_t *msg)
     Check if the message is a forwarded message. More...
     
    int mrmsg_is_increation (mrmsg_t *msg)
     Check if a message is still in creation. More...
     
    void mrmsg_latefiling_mediasize (mrmsg_t *msg, int width, int height, int duration)
     Late filing information to a message. More...
     
    @@ -181,48 +175,11 @@ Public Attributes - - - - - - - - - - - - - - - - - -

    Public Attributes

    uint32_t m_chat_id
     Chat ID the message belongs to. More...
     
    time_t m_timestamp
     Unix time the message was sended or received. More...
     
    int m_type
     Message type. More...
     
    int m_state
     Message state. More...
     
    char * m_text
     Message text. More...
     
    mrparam_tm_param
     Additional paramter for the message. More...
     
    int m_starred
     Starred-state of the message. More...
     

    Detailed Description

    An object representing a single message in memory.

    The message object is not updated. If you want an update, you have to recreate the object.

    Member Function Documentation

    - -
    -
    - - - - - - - -
    mrmsg_t * mrmsg_new ()
    -
    - -

    Create new message object.

    -

    Message objects are needed eg. for sending messages using mrmailbox_send_msg(). Moreover, they are returned eg. from mrmailbox_get_msg(), set up with the current state of a message. The message object is not updated; to achieve this, you have to recreate it.

    -
    Returns
    The created message object.
    - -
    -
    @@ -247,142 +204,6 @@ Public Attributes
    Returns
    None.
    - - - -
    -
    - - - - - - - - -
    void mrmsg_empty (mrmsg_tmsg)
    -
    - -

    Empty a message object.

    -
    Parameters
    - - -
    msgThe message object to empty.
    -
    -
    -
    Returns
    None.
    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - -
    void mrmsg_set_type (mrmsg_tmsg,
    int type 
    )
    -
    - -

    Set the type of a message.

    -

    See mrmailbox_send_msg() for some examples.

    -
    Parameters
    - - - -
    msgThe message object to modify.
    typeType to set for the message. Possible types are MR_MSG_TEXT (10), MR_MSG_IMAGE (20), MR_MSG_GIF (21), MR_MSG_AUDIO (40), MR_MSG_VOICE (41), MR_MSG_VIDEO (50) or MR_MSG_FILE (60).
    -
    -
    -
    Returns
    None.
    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - -
    void mrmsg_set_text (mrmsg_tmsg,
    const char * text 
    )
    -
    - -

    Set the text of a message object.

    -

    The text is not modified in the database, this function is only a helper to set up a message object to be sent afterwards. The type of the message object is not changed implicitly to MR_MSG_TEXT when using this function. Previously set texts are free()'d.

    -
    Parameters
    - - - -
    msgMessage to set the text for.
    textText to set. The function creates a copy of the given text so that it can be free()'d just after this function is called.
    -
    -
    -
    Returns
    None.
    - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - -
    void mrmsg_set_file (mrmsg_tmsg,
    const char * file 
    )
    -
    - -

    Set the file belonging to a message.

    -

    The file may be an image, a video, an audio file, an PDF and so on. This function is a shortcut for mrparam_set(msg->m_param, MRP_FILE, file)

    -
    Parameters
    - - - -
    msgThe message object to modify.
    filePath, filename and extension to set for the given message.
    -
    -
    -
    Returns
    None.
    -
    @@ -445,6 +266,32 @@ Public Attributes
    Returns
    The state of the message.
    + + + +
    +
    + + + + + + + + +
    time_t mrmsg_get_timestamp (mrmsg_tmsg)
    +
    + +

    Get message time.

    +

    Unix time the message was sended or received.

    +
    Parameters
    + + +
    msgThe message object.
    +
    +
    +
    Returns
    The time of the message.
    +
    @@ -787,6 +634,33 @@ Public Attributes
    Returns
    A summary for the given messages. The returned string must be free()'d.
    + + + +
    +
    + + + + + + + + +
    int mrmsg_is_starred (mrmsg_tmsg)
    +
    + +

    Check if a message is starred.

    +

    Starred messages are "favorites" marked by the user with a "star" or something like that. Starred messages can typically be shown easily and are not deleted automatically.

    +

    To star one or more messages, use mrmailbox_star_msgs(), to get a list of starred messages, use mrmailbox_get_chat_msgs() using MR_CHAT_ID_STARRED as the chat_id.

    +
    Parameters
    + + +
    msgThe message object.
    +
    +
    +
    Returns
    1=message is starred, 0=message not starred.
    +
    @@ -870,6 +744,60 @@ Public Attributes
    Returns
    1=message is still in creation (<filename>.increation exists), 0=message no longer in creation
    + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    void mrmsg_latefiling_mediasize (mrmsg_tmsg,
    int width,
    int height,
    int duration 
    )
    +
    + +

    Late filing information to a message.

    +

    Sometimes, the core cannot find out the width, the height or the duration of an image, an audio or a video.

    +

    If, in these cases, the frontend can provide the information, it can save them together with the message object for later usage.

    +

    This function should only be used if mrmsg_get_width(), mrmsg_get_height() or mrmsg_get_duration() do not provide the expected values.

    +

    To get the stored values later, use mrmsg_get_width(), mrmsg_get_height() or mrmsg_get_duration().

    +
    Parameters
    + + + + + +
    msgThe message object.
    widthThe new width to store in the message object. 0 if you do not want to change it.
    heightThe new height to store in the message object. 0 if you do not want to change it.
    durationThe new duration to store in the message object. 0 if you do not want to change it.
    +
    +
    +
    Returns
    None.
    +

    Member Data Documentation

    @@ -884,12 +812,7 @@ Public Attributes

    Message ID.

    -

    Special message IDs:

    - -

    Normal message IDs are larger than these special ones.

    +

    Never 0.

    @@ -904,7 +827,7 @@ Public Attributes

    Contact ID of the sender.

    -

    0 if unset. See mrcontact_t::m_id for special IDs. Use mrmailbox_get_contact() to load details about this contact.

    +

    Never 0. See mrcontact_t::m_id for special IDs. Use mrmailbox_get_contact() to load details about this contact.

    @@ -919,7 +842,7 @@ Public Attributes

    Contact ID of the recipient.

    -

    0 if unset. See mrcontact_t::m_id for special IDs. Use mrmailbox_get_contact() to load details about this contact.

    +

    Never 0. See mrcontact_t::m_id for special IDs. Use mrmailbox_get_contact() to load details about this contact.

    @@ -934,97 +857,7 @@ Public Attributes

    Chat ID the message belongs to.

    -

    0 if unset. See mrchat_t::m_id for special IDs. Use mrmailbox_get_chat() to load details about the chat.

    - -
    - - -
    -
    - - - - -
    time_t mrmsg_t::m_timestamp
    -
    - -

    Unix time the message was sended or received.

    -

    0 if unset.

    - -
    -
    - -
    -
    - - - - -
    int mrmsg_t::m_type
    -
    - -

    Message type.

    -

    It is recommended to use mrmsg_set_type() and mrmsg_get_type() to access this field.

    - -
    -
    - -
    -
    - - - - -
    int mrmsg_t::m_state
    -
    - -

    Message state.

    -

    It is recommended to use mrmsg_get_state() to access this field.

    - -
    -
    - -
    -
    - - - - -
    char* mrmsg_t::m_text
    -
    - -

    Message text.

    -

    NULL if unset. It is recommended to use mrmsg_set_text() and mrmsg_get_text() to access this field.

    - -
    -
    - -
    -
    - - - - -
    mrparam_t* mrmsg_t::m_param
    -
    - -

    Additional paramter for the message.

    -

    Never a NULL-pointer. It is recommended to use setters and getters instead of accessing this field directly.

    - -
    -
    - -
    -
    - - - - -
    int mrmsg_t::m_starred
    -
    - -

    Starred-state of the message.

    -

    0=no, 1=yes.

    +

    Never 0. See mrchat_t::m_id for special IDs. Use mrmailbox_get_chat() to load details about the chat.

    diff --git a/docs/html/structmrparam__t.html b/docs/html/structmrparam__t.html index cbb69b76..04af7580 100644 --- a/docs/html/structmrparam__t.html +++ b/docs/html/structmrparam__t.html @@ -308,7 +308,7 @@ Public Member Functions - +
    paramParameter object to modify.
    keyKey of the parameter to modify, one of the MRP_* constants.
    valueValue to store for key.
    valueValue to store for key. NULL to clear the value.