Delta Chat Core C-API
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 mrmailbox_t;
31 
32 
33 #define MR_CHAT_ID_DEADDROP 1 /* virtual chat showing all messages belonging to chats flagged with chats.blocked=2 */
34 #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) */
35 #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 sent and shown) */
36 #define MR_CHAT_ID_STARRED 5 /* virtual chat showing all messages flagged with msgs.starred=2 */
37 #define MR_CHAT_ID_ARCHIVED_LINK 6 /* only an indicator in a chatlist */
38 #define MR_CHAT_ID_LAST_SPECIAL 9 /* larger chat IDs are "real" chats, their messages are "real" messages. */
39 #define MR_CHAT_TYPE_UNDEFINED 0
40 #define MR_CHAT_TYPE_NORMAL 100
41 #define MR_CHAT_TYPE_GROUP 120
42 
43 
51 typedef struct _mrchat mrchat_t;
52 
53 
54 mrchat_t* mrchat_new (mrmailbox_t*);
55 void mrchat_empty (mrchat_t*);
56 void mrchat_unref (mrchat_t*);
57 
58 uint32_t mrchat_get_id (mrchat_t*);
60 char* mrchat_get_name (mrchat_t*);
63 char* mrchat_get_draft (mrchat_t*);
68 
69 
70 #ifdef __cplusplus
71 } /* /extern "C" */
72 #endif
73 #endif /* __MRCHAT_H__ */
int mrchat_is_unpromoted(mrchat_t *chat)
Check if a chat is still unpromoted.
Definition: mrchat.c:372
int mrchat_is_self_talk(mrchat_t *chat)
Check if a chat is a self talk.
Definition: mrchat.c:391
char * mrchat_get_draft(mrchat_t *chat)
Get draft for the chat, if any.
Definition: mrchat.c:301
char * mrchat_get_name(mrchat_t *chat)
Get name of a chat.
Definition: mrchat.c:190
time_t mrchat_get_draft_timestamp(mrchat_t *chat)
Get timestamp of the draft.
Definition: mrchat.c:322
int mrchat_get_archived(mrchat_t *chat)
Get archived state.
Definition: mrchat.c:348
An object representing a single mailbox.
uint32_t mrchat_get_id(mrchat_t *chat)
Get chat ID.
Definition: mrchat.c:137
void mrchat_unref(mrchat_t *chat)
Free a chat object.
Definition: mrchat.c:68
char * mrchat_get_profile_image(mrchat_t *chat)
Get the chat's profile image.
Definition: mrchat.c:278
int mrchat_get_type(mrchat_t *chat)
Get chat type.
Definition: mrchat.c:166
An object representing a single chat in memory.
char * mrchat_get_subtitle(mrchat_t *chat)
Get a subtitle for a chat.
Definition: mrchat.c:212