32 typedef struct sqlite3_stmt sqlite3_stmt;
53 #define MR_MSG_ID_MARKER1 1 54 #define MR_MSG_ID_DAYMARKER 9 55 #define MR_MSG_ID_LAST_SPECIAL 9 89 #define MR_MSG_UNDEFINED 0 90 #define MR_MSG_TEXT 10 91 #define MR_MSG_IMAGE 20 93 #define MR_MSG_AUDIO 40 94 #define MR_MSG_VOICE 41 95 #define MR_MSG_VIDEO 50 96 #define MR_MSG_FILE 60 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 120 char* m_server_folder;
121 uint32_t m_server_uid;
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);
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);
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);
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 ) 167 #define MR_MSG_MAKE_SUFFIX_SEARCHABLE(a) ((a)==MR_MSG_IMAGE || (a)==MR_MSG_GIF || (a)==MR_MSG_VOICE) 169 #define APPROX_SUBJECT_CHARS 32 An object representing a single mailbox.
Definition: mrmailbox.h:184
int mrmsg_is_systemcmd(mrmsg_t *msg)
Check if the message is a system command.
Definition: mrmsg.c:663
int mrmsg_get_type(mrmsg_t *msg)
Get the type of the message.
Definition: mrmsg.c:202
int m_type
Message type.
Definition: mrmsg.h:88
char * mrmsg_get_summarytext(mrmsg_t *msg, int approx_characters)
Get a message summary as a single line of text.
Definition: mrmsg.c:608
uint64_t mrmsg_get_filebytes(mrmsg_t *msg)
Get the size of the file.
Definition: mrmsg.c:379
uint32_t m_chat_id
Chat ID the message belongs to.
Definition: mrmsg.h:76
int mrmsg_get_state(mrmsg_t *msg)
Get the state of a message.
Definition: mrmsg.c:238
mrmsg_t * mrmsg_new()
Create new message object.
Definition: mrmsg.c:41
An object representing text with some attributes.
Definition: mrpoortext.h:35
mrpoortext_t * mrmsg_get_summary(mrmsg_t *msg, mrchat_t *chat)
Get a summary for a message.
Definition: mrmsg.c:566
void mrmsg_set_file(mrmsg_t *msg, const char *file)
Set the file belonging to a message.
Definition: mrmsg.c:177
mrpoortext_t * mrmsg_get_mediainfo(mrmsg_t *msg)
Get real author and title.
Definition: mrmsg.c:412
An object representing a single message in memory.
Definition: mrmsg.h:40
uint32_t m_to_id
Contact ID of the recipient.
Definition: mrmsg.h:69
uint32_t m_from_id
Contact ID of the sender.
Definition: mrmsg.h:62
int mrmsg_get_duration(mrmsg_t *msg)
Get duration of audio or video.
Definition: mrmsg.c:520
char * mrmsg_get_file(mrmsg_t *msg)
Find out full path, file name and extension of the file associated with a message.
Definition: mrmsg.c:279
int m_starred
Starred-state of the message.
Definition: mrmsg.h:114
void mrmsg_set_text(mrmsg_t *msg, const char *text)
Set the text of a message object.
Definition: mrmsg.c:153
An object for handling key=value parameter lists.
Definition: mrparam.h:44
int mrmsg_is_increation(mrmsg_t *msg)
Check if a message is still in creation.
Definition: mrmsg.c:903
mrparam_t * m_param
Additional paramter for the message.
Definition: mrmsg.h:113
char * m_text
Message text.
Definition: mrmsg.h:112
void mrmsg_unref(mrmsg_t *msg)
Free an mrmsg_t object created eg.
Definition: mrmsg.c:68
void mrmsg_set_type(mrmsg_t *msg, int type)
Set the type of a message.
Definition: mrmsg.c:126
uint32_t m_id
Message ID.
Definition: mrmsg.h:52
int m_state
Message state.
Definition: mrmsg.h:102
char * mrmsg_get_filemime(mrmsg_t *msg)
Get mime type of the file.
Definition: mrmsg.c:338
int mrmsg_get_width(mrmsg_t *msg)
Get width of image or video.
Definition: mrmsg.c:473
int mrmsg_get_showpadlock(mrmsg_t *msg)
Check if a padlock should be shown beside the message.
Definition: mrmsg.c:538
void mrmsg_save_param_to_disk(mrmsg_t *msg)
Add additional, persistent information to a message record.
Definition: mrmsg.c:946
char * mrmsg_get_filename(mrmsg_t *msg)
Get base file name without path.
Definition: mrmsg.c:306
void mrmsg_empty(mrmsg_t *msg)
Empty a message object.
Definition: mrmsg.c:89
char * mrmsg_get_text(mrmsg_t *msg)
Get the text of the message.
Definition: mrmsg.c:258
int mrmsg_is_forwarded(mrmsg_t *msg)
Check if the message is a forwarded message.
Definition: mrmsg.c:636
int mrmsg_get_height(mrmsg_t *msg)
Get height of image or video.
Definition: mrmsg.c:498
time_t m_timestamp
Unix time the message was sended or received.
Definition: mrmsg.h:82
An object representing a single chat in memory.
Definition: mrchat.h:39