diff --git a/docs/html/functions.html b/docs/html/functions.html index 39c2c304..57e2aaa8 100644 --- a/docs/html/functions.html +++ b/docs/html/functions.html @@ -145,8 +145,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); , mrcontact_t
  • m_param -: mrchat_t -, mrmsg_t +: mrmsg_t
  • m_starred : mrmsg_t @@ -190,9 +189,15 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • mrarray_unref() : mrarray_t
  • +
  • mrchat_get_profile_image() +: mrchat_t +
  • mrchat_get_subtitle() : mrchat_t
  • +
  • mrchat_get_unpromoted() +: mrchat_t +
  • mrchat_unref() : mrchat_t
  • @@ -211,9 +216,21 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • mrchatlist_unref() : mrchatlist_t
  • +
  • mrcontact_get_addr() +: mrcontact_t +
  • +
  • mrcontact_get_display_name() +: mrcontact_t +
  • mrcontact_get_first_name() : mrcontact_t
  • +
  • mrcontact_get_name() +: mrcontact_t +
  • +
  • mrcontact_get_name_n_addr() +: mrcontact_t +
  • mrcontact_normalize_name() : mrcontact_t
  • @@ -382,12 +399,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • mrmailbox_send_text_msg() : mrmailbox_t
  • -
  • mrmailbox_set_chat_image() -: mrmailbox_t -
  • mrmailbox_set_chat_name() : mrmailbox_t
  • +
  • mrmailbox_set_chat_profile_image() +: mrmailbox_t +
  • mrmailbox_set_config() : mrmailbox_t
  • @@ -412,6 +429,9 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • mrmsg_get_file() : mrmsg_t
  • +
  • mrmsg_get_filename() +: mrmsg_t +
  • mrmsg_get_mediainfo() : mrmsg_t
  • diff --git a/docs/html/functions_func.html b/docs/html/functions_func.html index a89b1d7e..ff40c217 100644 --- a/docs/html/functions_func.html +++ b/docs/html/functions_func.html @@ -106,9 +106,15 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • mrarray_unref() : mrarray_t
  • +
  • mrchat_get_profile_image() +: mrchat_t +
  • mrchat_get_subtitle() : mrchat_t
  • +
  • mrchat_get_unpromoted() +: mrchat_t +
  • mrchat_unref() : mrchat_t
  • @@ -127,9 +133,21 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • mrchatlist_unref() : mrchatlist_t
  • +
  • mrcontact_get_addr() +: mrcontact_t +
  • +
  • mrcontact_get_display_name() +: mrcontact_t +
  • mrcontact_get_first_name() : mrcontact_t
  • +
  • mrcontact_get_name() +: mrcontact_t +
  • +
  • mrcontact_get_name_n_addr() +: mrcontact_t +
  • mrcontact_normalize_name() : mrcontact_t
  • @@ -298,12 +316,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • mrmailbox_send_text_msg() : mrmailbox_t
  • -
  • mrmailbox_set_chat_image() -: mrmailbox_t -
  • mrmailbox_set_chat_name() : mrmailbox_t
  • +
  • mrmailbox_set_chat_profile_image() +: mrmailbox_t +
  • mrmailbox_set_config() : mrmailbox_t
  • @@ -325,6 +343,9 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • mrmsg_get_file() : mrmsg_t
  • +
  • mrmsg_get_filename() +: mrmsg_t +
  • mrmsg_get_mediainfo() : mrmsg_t
  • diff --git a/docs/html/functions_vars.html b/docs/html/functions_vars.html index 9bbae610..95c34089 100644 --- a/docs/html/functions_vars.html +++ b/docs/html/functions_vars.html @@ -145,8 +145,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); , mrcontact_t
  • m_param -: mrchat_t -, mrmsg_t +: mrmsg_t
  • m_starred : mrmsg_t diff --git a/docs/html/mrchat_8h_source.html b/docs/html/mrchat_8h_source.html index 17628818..247b2602 100644 --- a/docs/html/mrchat_8h_source.html +++ b/docs/html/mrchat_8h_source.html @@ -89,19 +89,20 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    mrchat.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 __MRCHAT_H__
    24 #define __MRCHAT_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 
    33 
    39 typedef struct mrchat_t
    40 {
    51  uint32_t m_id;
    52  #define MR_CHAT_ID_DEADDROP 1
    53  #define MR_CHAT_ID_TO_DEADDROP 2 /* messages send from us to unknown/unwanted users (this may happen when deleting chats or when using CC: in the email-program) */
    54  #define MR_CHAT_ID_TRASH 3 /* messages that should be deleted get this chat_id; the messages are deleted from the working thread later then. This is also needed as rfc724_mid should be preset as long as the message is not deleted on the server (otherwise it is downloaded again) */
    55  #define MR_CHAT_ID_MSGS_IN_CREATION 4 /* a message is just in creation but not yet assigned to a chat (eg. we may need the message ID to set up blobs; this avoids unready message to be send and shown) */
    56  #define MR_CHAT_ID_STARRED 5
    57  #define MR_CHAT_ID_ARCHIVED_LINK 6
    58  #define MR_CHAT_ID_LAST_SPECIAL 9 /* larger chat IDs are "real" chats, their messages are "real" messages. */
    59 
    60 
    69  int m_type;
    70  #define MR_CHAT_TYPE_UNDEFINED 0
    71  #define MR_CHAT_TYPE_NORMAL 100
    72  #define MR_CHAT_TYPE_GROUP 120
    73 
    74 
    86  char* m_name;
    87 
    97 
    107 
    112 
    127 
    134 
    136  char* m_grpid; /* NULL if unset */
    137 } mrchat_t;
    138 
    139 
    140 mrchat_t* mrchat_new (mrmailbox_t*);
    141 void mrchat_empty (mrchat_t*);
    142 void mrchat_unref (mrchat_t*);
    143 
    145 
    146 /* library-internal */
    147 int mrchat_load_from_db__ (mrchat_t*, uint32_t id);
    148 int mrchat_update_param__ (mrchat_t*);
    149 
    150 #define MR_CHAT_PREFIX "Chat:" /* you MUST NOT modify this or the following strings */
    151 #define MR_CHATS_FOLDER "Chats" /* if we want to support Gma'l-labels - "Chats" is a reserved word for Gma'l */
    152 
    153 
    154 #ifdef __cplusplus
    155 } /* /extern "C" */
    156 #endif
    157 #endif /* __MRCHAT_H__ */
    int m_type
    Chat type.
    Definition: mrchat.h:69
    +
    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 __MRCHAT_H__
    24 #define __MRCHAT_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 
    33 
    39 typedef struct mrchat_t
    40 {
    51  uint32_t m_id;
    52  #define MR_CHAT_ID_DEADDROP 1
    53  #define MR_CHAT_ID_TO_DEADDROP 2 /* messages send from us to unknown/unwanted users (this may happen when deleting chats or when using CC: in the email-program) */
    54  #define MR_CHAT_ID_TRASH 3 /* messages that should be deleted get this chat_id; the messages are deleted from the working thread later then. This is also needed as rfc724_mid should be preset as long as the message is not deleted on the server (otherwise it is downloaded again) */
    55  #define MR_CHAT_ID_MSGS_IN_CREATION 4 /* a message is just in creation but not yet assigned to a chat (eg. we may need the message ID to set up blobs; this avoids unready message to be send and shown) */
    56  #define MR_CHAT_ID_STARRED 5
    57  #define MR_CHAT_ID_ARCHIVED_LINK 6
    58  #define MR_CHAT_ID_LAST_SPECIAL 9 /* larger chat IDs are "real" chats, their messages are "real" messages. */
    59 
    60 
    69  int m_type;
    70  #define MR_CHAT_TYPE_UNDEFINED 0
    71  #define MR_CHAT_TYPE_NORMAL 100
    72  #define MR_CHAT_TYPE_GROUP 120
    73 
    74 
    86  char* m_name;
    87 
    97 
    107 
    112 
    127 
    129  char* m_grpid;
    130  mrparam_t* m_param;
    131 } mrchat_t;
    132 
    133 
    134 mrchat_t* mrchat_new (mrmailbox_t*);
    135 void mrchat_empty (mrchat_t*);
    136 void mrchat_unref (mrchat_t*);
    137 
    141 
    142 /* library-internal */
    143 int mrchat_load_from_db__ (mrchat_t*, uint32_t id);
    144 int mrchat_update_param__ (mrchat_t*);
    145 
    146 #define MR_CHAT_PREFIX "Chat:" /* you MUST NOT modify this or the following strings */
    147 #define MR_CHATS_FOLDER "Chats" /* if we want to support Gma'l-labels - "Chats" is a reserved word for Gma'l */
    148 
    149 
    150 #ifdef __cplusplus
    151 } /* /extern "C" */
    152 #endif
    153 #endif /* __MRCHAT_H__ */
    int m_type
    Chat type.
    Definition: mrchat.h:69
    An object representing a single mailbox.
    Definition: mrmailbox.h:184
    void mrchat_unref(mrchat_t *chat)
    Free a chat object.
    Definition: mrchat.c:65
    +
    int mrchat_get_unpromoted(mrchat_t *chat)
    Check if a chat is still unpromoted.
    Definition: mrchat.c:130
    char * m_draft_text
    The draft text.
    Definition: mrchat.h:106
    mrmailbox_t * m_mailbox
    The mailbox object the chat belongs to.
    Definition: mrchat.h:111
    -
    mrparam_t * m_param
    Additional parameters for the chat.
    Definition: mrchat.h:133
    int m_archived
    Flag for the archived state.
    Definition: mrchat.h:126
    char * m_name
    Name of the chat.
    Definition: mrchat.h:86
    An object for handling key=value parameter lists.
    Definition: mrparam.h:44
    +
    char * mrchat_get_profile_image(mrchat_t *chat)
    Get the chat's profile image.
    Definition: mrchat.c:151
    time_t m_draft_timestamp
    Timestamp of the draft.
    Definition: mrchat.h:96
    uint32_t m_id
    Chat ID under which the chat is filed in the database.
    Definition: mrchat.h:51
    An object representing a single chat in memory.
    Definition: mrchat.h:39
    -
    char * mrchat_get_subtitle(mrchat_t *chat)
    Get a subtitle for a chat.
    Definition: mrchat.c:120
    +
    char * mrchat_get_subtitle(mrchat_t *chat)
    Get a subtitle for a chat.
    Definition: mrchat.c:171
    -
    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 __MRCONTACT_H__
    24 #define __MRCONTACT_H__
    25 #ifdef __cplusplus
    26 extern "C" {
    27 #endif
    28 
    29 
    30 typedef struct mrsqlite3_t mrsqlite3_t;
    31 
    32 
    38 typedef struct mrcontact_t
    39 {
    48  uint32_t m_id;
    49  #define MR_CONTACT_ID_SELF 1
    50  #define MR_CONTACT_ID_LAST_SPECIAL 9
    51 
    60  char* m_name;
    61 
    69  char* m_authname;
    70 
    76  char* m_addr;
    77 
    84  int m_blocked;
    85 
    87  int m_origin;
    88 } mrcontact_t;
    89 
    90 
    91 mrcontact_t* mrcontact_new (); /* the returned pointer is ref'd and must be unref'd after usage */
    92 void mrcontact_empty (mrcontact_t*);
    94 
    95 
    96 /* contact origins */
    97 #define MR_ORIGIN_UNSET 0
    98 #define MR_ORIGIN_INCOMING_UNKNOWN_FROM 0x10 /* From: of incoming messages of unknown sender */
    99 #define MR_ORIGIN_INCOMING_UNKNOWN_CC 0x20 /* Cc: of incoming messages of unknown sender */
    100 #define MR_ORIGIN_INCOMING_UNKNOWN_TO 0x40 /* To: of incoming messages of unknown sender */
    101 #define MR_ORIGIN_INCOMING_REPLY_TO 0x100 /* Reply-To: of incoming message of known sender */
    102 #define MR_ORIGIN_INCOMING_CC 0x200 /* Cc: of incoming message of known sender */
    103 #define MR_ORIGIN_INCOMING_TO 0x400 /* additional To:'s of incoming message of known sender */
    104 #define MR_ORIGIN_CREATE_CHAT 0x800 /* a chat was manually created for this user, but no message yet sent */
    105 #define MR_ORIGIN_OUTGOING_BCC 0x1000 /* message send by us */
    106 #define MR_ORIGIN_OUTGOING_CC 0x2000 /* message send by us */
    107 #define MR_ORIGIN_OUTGOING_TO 0x4000 /* message send by us */
    108 #define MR_ORIGIN_INTERNAL 0x40000 /* internal use */
    109 #define MR_ORIGIN_ADRESS_BOOK 0x80000 /* address is in our address book */
    110 #define MR_ORIGIN_MANUALLY_CREATED 0x100000 /* contact added by mrmailbox_create_contact() */
    111 
    112 #define MR_ORIGIN_MIN_CONTACT_LIST (MR_ORIGIN_INCOMING_REPLY_TO) /* contacts with at least this origin value are shown in the contact list */
    113 #define MR_ORIGIN_MIN_VERIFIED (MR_ORIGIN_INCOMING_REPLY_TO) /* contacts with at least this origin value are verified and known not to be spam */
    114 #define MR_ORIGIN_MIN_START_NEW_NCHAT (0x7FFFFFFF) /* contacts with at least this origin value start a new "normal" chat, defaults to off */
    115 
    116 
    117 /* library-internal */
    118 char* mrcontact_get_first_name (const char* full_name);
    119 void mrcontact_normalize_name (char* full_name);
    120 int mrcontact_load_from_db__ (mrcontact_t*, mrsqlite3_t*, uint32_t contact_id);
    121 
    122 
    123 #ifdef __cplusplus
    124 } /* /extern "C" */
    125 #endif
    126 #endif /* __MRCONTACT_H__ */
    char * mrcontact_get_first_name(const char *full_name)
    Get the first name.
    Definition: mrcontact.c:113
    +
    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 __MRCONTACT_H__
    24 #define __MRCONTACT_H__
    25 #ifdef __cplusplus
    26 extern "C" {
    27 #endif
    28 
    29 
    30 typedef struct mrsqlite3_t mrsqlite3_t;
    31 
    32 
    38 typedef struct mrcontact_t
    39 {
    48  uint32_t m_id;
    49  #define MR_CONTACT_ID_SELF 1
    50  #define MR_CONTACT_ID_LAST_SPECIAL 9
    51 
    55  char* m_name;
    56 
    62  char* m_authname;
    63 
    67  char* m_addr;
    68 
    75  int m_blocked;
    76 
    78  int m_origin;
    79 } mrcontact_t;
    80 
    81 
    82 mrcontact_t* mrcontact_new (); /* the returned pointer is ref'd and must be unref'd after usage */
    83 void mrcontact_empty (mrcontact_t*);
    85 
    90 char* mrcontact_get_first_name (const char* full_name);
    91 void mrcontact_normalize_name (char* full_name);
    92 
    93 
    94 /* contact origins */
    95 #define MR_ORIGIN_UNSET 0
    96 #define MR_ORIGIN_INCOMING_UNKNOWN_FROM 0x10 /* From: of incoming messages of unknown sender */
    97 #define MR_ORIGIN_INCOMING_UNKNOWN_CC 0x20 /* Cc: of incoming messages of unknown sender */
    98 #define MR_ORIGIN_INCOMING_UNKNOWN_TO 0x40 /* To: of incoming messages of unknown sender */
    99 #define MR_ORIGIN_INCOMING_REPLY_TO 0x100 /* Reply-To: of incoming message of known sender */
    100 #define MR_ORIGIN_INCOMING_CC 0x200 /* Cc: of incoming message of known sender */
    101 #define MR_ORIGIN_INCOMING_TO 0x400 /* additional To:'s of incoming message of known sender */
    102 #define MR_ORIGIN_CREATE_CHAT 0x800 /* a chat was manually created for this user, but no message yet sent */
    103 #define MR_ORIGIN_OUTGOING_BCC 0x1000 /* message send by us */
    104 #define MR_ORIGIN_OUTGOING_CC 0x2000 /* message send by us */
    105 #define MR_ORIGIN_OUTGOING_TO 0x4000 /* message send by us */
    106 #define MR_ORIGIN_INTERNAL 0x40000 /* internal use */
    107 #define MR_ORIGIN_ADRESS_BOOK 0x80000 /* address is in our address book */
    108 #define MR_ORIGIN_MANUALLY_CREATED 0x100000 /* contact added by mrmailbox_create_contact() */
    109 
    110 #define MR_ORIGIN_MIN_CONTACT_LIST (MR_ORIGIN_INCOMING_REPLY_TO) /* contacts with at least this origin value are shown in the contact list */
    111 #define MR_ORIGIN_MIN_VERIFIED (MR_ORIGIN_INCOMING_REPLY_TO) /* contacts with at least this origin value are verified and known not to be spam */
    112 #define MR_ORIGIN_MIN_START_NEW_NCHAT (0x7FFFFFFF) /* contacts with at least this origin value start a new "normal" chat, defaults to off */
    113 
    114 
    115 /* library-internal */
    116 int mrcontact_load_from_db__ (mrcontact_t*, mrsqlite3_t*, uint32_t contact_id);
    117 
    118 
    119 #ifdef __cplusplus
    120 } /* /extern "C" */
    121 #endif
    122 #endif /* __MRCONTACT_H__ */
    char * mrcontact_get_name_n_addr(mrcontact_t *contact)
    Get a summary of name and address.
    Definition: mrcontact.c:193
    +
    char * mrcontact_get_first_name(const char *full_name)
    Get the first name.
    Definition: mrcontact.c:219
    An object representing a single contact in memory.
    Definition: mrcontact.h:38
    void mrcontact_unref(mrcontact_t *contact)
    Free a contact object.
    Definition: mrcontact.c:57
    -
    void mrcontact_normalize_name(char *full_name)
    Normalize a name in-place.
    Definition: mrcontact.c:144
    -
    char * m_authname
    Name authorized by the contact himself.
    Definition: mrcontact.h:69
    -
    int m_blocked
    Blocked state.
    Definition: mrcontact.h:84
    -
    char * m_addr
    The E-Mail-Address of the contact.
    Definition: mrcontact.h:76
    -
    char * m_name
    Name given by the user to the contact.
    Definition: mrcontact.h:60
    +
    char * mrcontact_get_display_name(mrcontact_t *contact)
    Get display name.
    Definition: mrcontact.c:162
    +
    void mrcontact_normalize_name(char *full_name)
    Normalize a name in-place.
    Definition: mrcontact.c:257
    +
    char * mrcontact_get_addr(mrcontact_t *contact)
    Get email address.
    Definition: mrcontact.c:115
    +
    char * m_authname
    Name authorized by the contact himself.
    Definition: mrcontact.h:62
    +
    int m_blocked
    Blocked state.
    Definition: mrcontact.h:75
    +
    char * mrcontact_get_name(mrcontact_t *contact)
    Get name.
    Definition: mrcontact.c:139
    +
    char * m_addr
    E-Mail-Address of the contact.
    Definition: mrcontact.h:67
    +
    char * m_name
    Contact name.
    Definition: mrcontact.h:55
    uint32_t m_id
    The contact ID.
    Definition: mrcontact.h:48
    diff --git a/docs/html/mrevent_8h.html b/docs/html/mrevent_8h.html index 9f69af9a..1b033d61 100644 --- a/docs/html/mrevent_8h.html +++ b/docs/html/mrevent_8h.html @@ -109,7 +109,7 @@ Macros  The user should show an error. More...
      #define MR_EVENT_MSGS_CHANGED   2000 - One or more messages changed for some reasons in the database. More...
    + Messages or chats changed. More...
      #define MR_EVENT_INCOMING_MSG   2005  There is a fresh message. More...
    @@ -121,7 +121,7 @@ Macros  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). More...
      #define MR_EVENT_CHAT_MODIFIED   2020 - Group name/image changed or members added/removed. More...
    + Group changed. More...
      #define MR_EVENT_CONTACTS_CHANGED   2030  Contact(s) created, renamed, blocked or deleted. More...
    @@ -158,65 +158,45 @@ Macros

    The following constants are used as events reported to the callback given to mrmailbox_new().

    If you do not want to handle an event, it is always safe to return 0, so there is no need to add a "case" for every event.

    Macro Definition Documentation

    - +
    - +
    #define MR_EVENT_CHAT_MODIFIED   2020#define MR_EVENT_INFO   100
    -

    Group name/image changed or members added/removed.

    -
    Parameters
    - - - -
    data1chat_id
    data20
    -
    -
    -
    Returns
    0
    - -
    -
    - -
    -
    - - - - -
    #define MR_EVENT_CONFIGURE_PROGRESS   2041
    -
    - -

    Inform about the configuration progress started by mrmailbox_configure_and_connect().

    -
    Parameters
    - - - -
    data1Permille
    data20
    -
    -
    -
    Returns
    0
    - -
    -
    - -
    -
    - - - - -
    #define MR_EVENT_CONTACTS_CHANGED   2030
    -
    - -

    Contact(s) created, renamed, blocked or deleted.

    +

    The user may write an informational string to the log.

    +

    Passed to the callback given to mrmailbox_new(). This event should not be reported using a popup or something like that.

    Parameters
    - + +
    data10
    data20
    data2Info string
    +
    +
    +
    Returns
    0
    + +
    +
    + +
    +
    + + + + +
    #define MR_EVENT_WARNING   300
    +
    + +

    The user should write an warning string to the log.

    +

    Passed to the callback given to mrmailbox_new(). This event should not be reported using a popup or something like that.

    +
    Parameters
    + + +
    data10
    data2Warning string
    @@ -247,135 +227,27 @@ Macros
    - +
    - +
    #define MR_EVENT_GET_QUANTITY_STRING   2092#define MR_EVENT_MSGS_CHANGED   2000
    -

    Requeste a localized quantitiy string from the frontend.

    -

    Quantitiy strings may have eg. different plural forms and usually also include the count itself to the string. Typical strings in this form are "1 Message" vs. "2 Messages".

    +

    Messages or chats changed.

    +

    One or more messages or chats changed for various reasons in the database:

      +
    • Messages send, received or removed
    • +
    • A message could not be sent (see mrmsg_get_state()/MR_STATE_OUT_ERROR)
    • +
    • Chats created, deleted or archived
    • +
    • A draft has been set
    • +
    Parameters
    - - -
    data1ID of the string to request, one of the MR_STR_* constants as defined in mrstock.h
    data2The count. The frontend may retrurn different strings on this value and normally also includes the value itself to the string.
    -
    -
    -
    Returns
    Null-terminated UTF-8 string. CAVE: The string will be free()'d by the core, so make sure it is allocated using malloc() or a compatible function. If you cannot provide the requested string, just return 0; the core will use a default string then.
    - -
    -
    - -
    -
    - - - - -
    #define MR_EVENT_GET_STRING   2091
    -
    - -

    Requeste a localized string from the frontend.

    -
    Parameters
    - - - -
    data1ID of the string to request, one of the MR_STR_* constants as defined in mrstock.h
    data20
    -
    -
    -
    Returns
    Null-terminated UTF-8 string. CAVE: The string will be free()'d by the core, so make sure it is allocated using malloc() or a compatible function. If you cannot provide the requested string, just return 0; the core will use a default string then.
    - -
    -
    - -
    -
    - - - - -
    #define MR_EVENT_HTTP_GET   2100
    -
    - -

    Request a HTTP-file from the frontend.

    -
    Parameters
    - - - -
    data1URL
    data20
    -
    -
    -
    Returns
    The content of the requested file as a null-terminated UTF-8 string. CAVE: The string will be free()'d by the core, so make sure it is allocated using malloc() or a compatible function. If you cannot provide the content, just return 0.
    - -
    -
    - -
    -
    - - - - -
    #define MR_EVENT_IMEX_ENDED   2050
    -
    - -

    Import/export done.

    -

    You'll get this event from a call to mrmailbox_imex(). As we want to get rid of the threads in the core, this event may be deleted.

    -
    Parameters
    - - - -
    data10:failed, 1=success
    data20
    -
    -
    -
    Returns
    0
    - -
    -
    - -
    -
    - - - - -
    #define MR_EVENT_IMEX_FILE_WRITTEN   2052
    -
    - -

    A file has been exported.

    -

    A file has been written by mrmailbox_imex(). This event may be send multiple times by a single call to mrmailbox_imex(); if the export is done, MR_EVENT_IMEX_ENDED is sent.

    -

    A typical purpose for a handler of this event may be to make the file public to some system services.

    -
    Parameters
    - - - -
    data1File name
    data20
    -
    -
    -
    Returns
    0
    - -
    -
    - -
    -
    - - - - -
    #define MR_EVENT_IMEX_PROGRESS   2051
    -
    - -

    Inform about the import/export progress started by mrmailbox_imex().

    -
    Parameters
    - - - + +
    data1Permille
    data20
    data1chat_id for single added messages
    data2msg_id for single added messages
    @@ -395,6 +267,7 @@ Macros

    There is a fresh message.

    Typically, the user will show an notification when receiving this message.

    +

    There is no extra MR_EVENT_MSGS_CHANGED event send together with this event.

    Parameters
    @@ -404,52 +277,6 @@ Macros
    Returns
    0
    - - - -
    -
    -
    data1chat_id
    - - - -
    #define MR_EVENT_INFO   100
    -
    - -

    The user may write an informational string to the log.

    -

    Passed to the callback given to mrmailbox_new(). This event should not be reported using a popup or something like that.

    -
    Parameters
    - - - -
    data10
    data2Info string
    -
    -
    -
    Returns
    0
    - -
    -
    - -
    -
    - - - - -
    #define MR_EVENT_IS_OFFLINE   2081
    -
    - -

    Ask the frontend about the offline state.

    -

    This function may be provided by the frontend. If we already know, that we're offline, eg. there is no need to try to connect and things will speed up.

    -
    Parameters
    - - - -
    data10
    data20
    -
    -
    -
    Returns
    0=online, 1=offline
    -
    @@ -496,27 +323,230 @@ Macros
    - +
    - +
    #define MR_EVENT_MSGS_CHANGED   2000#define MR_EVENT_CHAT_MODIFIED   2020
    -

    One or more messages changed for some reasons in the database.

    -

    Messages may be added or removed.

    +

    Group changed.

    +

    The name or the image of a chat group was changed or members were added or removed. See mrmailbox_set_chat_name(), mrmailbox_set_chat_profile_image(), mrmailbox_add_contact_to_chat() and mrmailbox_remove_contact_from_chat().

    Parameters
    - - + +
    data1chat_id for single added messages
    data2msg_id for single added messages
    data1chat_id
    data20
    Returns
    0
    +
    +
    + +
    +
    + + + + +
    #define MR_EVENT_CONTACTS_CHANGED   2030
    +
    + +

    Contact(s) created, renamed, blocked or deleted.

    +
    Parameters
    + + + +
    data10
    data20
    +
    +
    +
    Returns
    0
    + +
    +
    + +
    +
    + + + + +
    #define MR_EVENT_CONFIGURE_PROGRESS   2041
    +
    + +

    Inform about the configuration progress started by mrmailbox_configure_and_connect().

    +
    Parameters
    + + + +
    data1Permille
    data20
    +
    +
    +
    Returns
    0
    + +
    +
    + +
    +
    + + + + +
    #define MR_EVENT_IMEX_ENDED   2050
    +
    + +

    Import/export done.

    +

    You'll get this event from a call to mrmailbox_imex(). As we want to get rid of the threads in the core, this event may be deleted.

    +
    Parameters
    + + + +
    data10:failed, 1=success
    data20
    +
    +
    +
    Returns
    0
    + +
    +
    + +
    +
    + + + + +
    #define MR_EVENT_IMEX_PROGRESS   2051
    +
    + +

    Inform about the import/export progress started by mrmailbox_imex().

    +
    Parameters
    + + + +
    data1Permille
    data20
    +
    +
    +
    Returns
    0
    + +
    +
    + +
    +
    + + + + +
    #define MR_EVENT_IMEX_FILE_WRITTEN   2052
    +
    + +

    A file has been exported.

    +

    A file has been written by mrmailbox_imex(). This event may be send multiple times by a single call to mrmailbox_imex(); if the export is done, MR_EVENT_IMEX_ENDED is sent.

    +

    A typical purpose for a handler of this event may be to make the file public to some system services.

    +
    Parameters
    + + + +
    data1File name
    data20
    +
    +
    +
    Returns
    0
    + +
    +
    + +
    +
    + + + + +
    #define MR_EVENT_IS_OFFLINE   2081
    +
    + +

    Ask the frontend about the offline state.

    +

    This function may be provided by the frontend. If we already know, that we're offline, eg. there is no need to try to connect and things will speed up.

    +
    Parameters
    + + + +
    data10
    data20
    +
    +
    +
    Returns
    0=online, 1=offline
    + +
    +
    + +
    +
    + + + + +
    #define MR_EVENT_GET_STRING   2091
    +
    + +

    Requeste a localized string from the frontend.

    +
    Parameters
    + + + +
    data1ID of the string to request, one of the MR_STR_* constants as defined in mrstock.h
    data20
    +
    +
    +
    Returns
    Null-terminated UTF-8 string. CAVE: The string will be free()'d by the core, so make sure it is allocated using malloc() or a compatible function. If you cannot provide the requested string, just return 0; the core will use a default string then.
    + +
    +
    + +
    +
    + + + + +
    #define MR_EVENT_GET_QUANTITY_STRING   2092
    +
    + +

    Requeste a localized quantitiy string from the frontend.

    +

    Quantitiy strings may have eg. different plural forms and usually also include the count itself to the string. Typical strings in this form are "1 Message" vs. "2 Messages".

    +
    Parameters
    + + + +
    data1ID of the string to request, one of the MR_STR_* constants as defined in mrstock.h
    data2The count. The frontend may retrurn different strings on this value and normally also includes the value itself to the string.
    +
    +
    +
    Returns
    Null-terminated UTF-8 string. CAVE: The string will be free()'d by the core, so make sure it is allocated using malloc() or a compatible function. If you cannot provide the requested string, just return 0; the core will use a default string then.
    + +
    +
    + +
    +
    + + + + +
    #define MR_EVENT_HTTP_GET   2100
    +
    + +

    Request a HTTP-file from the frontend.

    +
    Parameters
    + + + +
    data1URL
    data20
    +
    +
    +
    Returns
    The content of the requested file as a null-terminated UTF-8 string. CAVE: The string will be free()'d by the core, so make sure it is allocated using malloc() or a compatible function. If you cannot provide the content, just return 0.
    +
    @@ -540,29 +570,6 @@ Macros
    Returns
    0
    - - - -
    -
    - - - - -
    #define MR_EVENT_WARNING   300
    -
    - -

    The user should write an warning string to the log.

    -

    Passed to the callback given to mrmailbox_new(). This event should not be reported using a popup or something like that.

    -
    Parameters
    - - - -
    data10
    data2Warning string
    -
    -
    -
    Returns
    0
    -
    diff --git a/docs/html/mrevent_8h_source.html b/docs/html/mrevent_8h_source.html index 675386eb..6f01a401 100644 --- a/docs/html/mrevent_8h_source.html +++ b/docs/html/mrevent_8h_source.html @@ -89,7 +89,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    mrevent.h
    -Go to the documentation of this file.
    1 /*******************************************************************************
    2  *
    3  * Delta Chat Core
    4  * Contact: r10s@b44t.com, http://b44t.com
    5  *
    6  * This program is free software: you can redistribute it and/or modify it under
    7  * the terms of the GNU General Public License as published by the Free Software
    8  * Foundation, either version 3 of the License, or (at your option) any later
    9  * version.
    10  *
    11  * This program is distributed in the hope that it will be useful, but WITHOUT
    12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    13  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
    14  * details.
    15  *
    16  * You should have received a copy of the GNU General Public License along with
    17  * this program. If not, see http://www.gnu.org/licenses/ .
    18  *
    19  ******************************************************************************/
    20 
    21 
    22 #ifndef __MREVENT_H__
    23 #define __MREVENT_H__
    24 #ifdef __cplusplus
    25 extern "C" {
    26 #endif
    27 
    28 
    49 #define MR_EVENT_INFO 100
    50 
    51 
    63 #define MR_EVENT_WARNING 300
    64 
    65 
    76 #define MR_EVENT_ERROR 400
    77 
    78 
    89 #define MR_EVENT_MSGS_CHANGED 2000
    90 
    91 
    102 #define MR_EVENT_INCOMING_MSG 2005
    103 
    104 
    115 #define MR_EVENT_MSG_DELIVERED 2010
    116 
    117 
    128 #define MR_EVENT_MSG_READ 2015
    129 
    130 
    140 #define MR_EVENT_CHAT_MODIFIED 2020
    141 
    142 
    152 #define MR_EVENT_CONTACTS_CHANGED 2030
    153 
    154 
    164 #define MR_EVENT_CONFIGURE_PROGRESS 2041
    165 
    166 
    177 #define MR_EVENT_IMEX_ENDED 2050
    178 
    179 
    189 #define MR_EVENT_IMEX_PROGRESS 2051
    190 
    191 
    206 #define MR_EVENT_IMEX_FILE_WRITTEN 2052
    207 
    208 
    209 /*******************************************************************************
    210  * The following events are functions that should be provided by the frontends
    211  ******************************************************************************/
    212 
    213 
    225 #define MR_EVENT_IS_OFFLINE 2081
    226 
    227 
    239 #define MR_EVENT_GET_STRING 2091
    240 
    241 
    256 #define MR_EVENT_GET_QUANTITY_STRING 2092
    257 
    258 
    270 #define MR_EVENT_HTTP_GET 2100
    271 
    285 #define MR_EVENT_WAKE_LOCK 2110
    286 
    287 
    288 #ifdef __cplusplus
    289 } /* /extern "C" */
    290 #endif
    291 #endif /* __MREVENT_H__ */
    292 
    +Go to the documentation of this file.
    1 /*******************************************************************************
    2  *
    3  * Delta Chat Core
    4  * Contact: r10s@b44t.com, http://b44t.com
    5  *
    6  * This program is free software: you can redistribute it and/or modify it under
    7  * the terms of the GNU General Public License as published by the Free Software
    8  * Foundation, either version 3 of the License, or (at your option) any later
    9  * version.
    10  *
    11  * This program is distributed in the hope that it will be useful, but WITHOUT
    12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    13  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
    14  * details.
    15  *
    16  * You should have received a copy of the GNU General Public License along with
    17  * this program. If not, see http://www.gnu.org/licenses/ .
    18  *
    19  ******************************************************************************/
    20 
    21 
    22 #ifndef __MREVENT_H__
    23 #define __MREVENT_H__
    24 #ifdef __cplusplus
    25 extern "C" {
    26 #endif
    27 
    28 
    49 #define MR_EVENT_INFO 100
    50 
    51 
    63 #define MR_EVENT_WARNING 300
    64 
    65 
    76 #define MR_EVENT_ERROR 400
    77 
    78 
    93 #define MR_EVENT_MSGS_CHANGED 2000
    94 
    95 
    108 #define MR_EVENT_INCOMING_MSG 2005
    109 
    110 
    121 #define MR_EVENT_MSG_DELIVERED 2010
    122 
    123 
    134 #define MR_EVENT_MSG_READ 2015
    135 
    136 
    148 #define MR_EVENT_CHAT_MODIFIED 2020
    149 
    150 
    160 #define MR_EVENT_CONTACTS_CHANGED 2030
    161 
    162 
    172 #define MR_EVENT_CONFIGURE_PROGRESS 2041
    173 
    174 
    185 #define MR_EVENT_IMEX_ENDED 2050
    186 
    187 
    197 #define MR_EVENT_IMEX_PROGRESS 2051
    198 
    199 
    214 #define MR_EVENT_IMEX_FILE_WRITTEN 2052
    215 
    216 
    217 /*******************************************************************************
    218  * The following events are functions that should be provided by the frontends
    219  ******************************************************************************/
    220 
    221 
    233 #define MR_EVENT_IS_OFFLINE 2081
    234 
    235 
    247 #define MR_EVENT_GET_STRING 2091
    248 
    249 
    264 #define MR_EVENT_GET_QUANTITY_STRING 2092
    265 
    266 
    278 #define MR_EVENT_HTTP_GET 2100
    279 
    293 #define MR_EVENT_WAKE_LOCK 2110
    294 
    295 
    296 #ifdef __cplusplus
    297 } /* /extern "C" */
    298 #endif
    299 #endif /* __MREVENT_H__ */
    300