1
0
Fork 0
mirror of https://github.com/deltachat/deltachat-core.git synced 2025-10-06 03:50:08 +02:00
This commit is contained in:
B. Petersen 2016-07-27 12:08:16 +02:00
parent cc7057d2b4
commit b4f84d4d89
2 changed files with 4 additions and 3 deletions

View file

@ -74,8 +74,9 @@ public:
private:
// the mailbox, the chat belongs to
#define MR_CHAT_FIELDS " c.id, c.type, c.name "
#define MR_GET_CHATS_PREFIX "SELECT " MR_CHAT_FIELDS "," MR_MSG_FIELDS " FROM chats c LEFT JOIN msg m ON (c.id=m.chat_id AND m.timestamp=(SELECT MIN(timestamp) FROM msg WHERE chat_id=c.id)) "
#define MR_CHAT_FIELDS " c.id,c.type,c.name "
#define MR_GET_CHATS_PREFIX "SELECT " MR_CHAT_FIELDS "," MR_MSG_FIELDS " FROM chats c " \
"LEFT JOIN msg m ON (c.id=m.chat_id AND m.timestamp=(SELECT MIN(timestamp) FROM msg WHERE chat_id=c.id)) "
bool SetChatFromStmt (sqlite3_stmt* row);
void Empty ();
MrMailbox* m_mailbox;

View file

@ -65,7 +65,7 @@ public:
MrMsg (MrMailbox*);
~MrMsg ();
#define MR_MSG_FIELDS " m.id, m.from_id, m.timestamp, m.type, m.state, m.msg " // we use a define for easier string concatenation
#define MR_MSG_FIELDS " m.id,m.from_id,m.timestamp, m.type,m.state,m.msg " // we use a define for easier string concatenation
bool SetMsgFromStmt (sqlite3_stmt* row, int row_offset=0); // row order is MR_MSG_FIELDS
static size_t GetMsgCnt (MrMailbox*);