Automatically fetch new messages.

This commit is contained in:
2018-12-17 20:24:24 +01:00
parent 41cd02dfec
commit 6e7645f17b
6 changed files with 75 additions and 5 deletions

View File

@ -0,0 +1,16 @@
#include "conversationmessageslist.h"
ConversationMessagesList::ConversationMessagesList()
{
}
int ConversationMessagesList::getLastMessageID()
{
//Return -1 by default if there is not any message in the conversation
if(count() == 0)
return -1;
return at(count() -1).iD();
}

View File

@ -0,0 +1,28 @@
/**
* Conversations messages list container
*
* @author Pierre HUBERT
*/
#ifndef CONVERSATIONMESSAGESLIST_H
#define CONVERSATIONMESSAGESLIST_H
#include <QList>
#include "conversationmessage.h"
class ConversationMessagesList : public QList<ConversationMessage>
{
public:
ConversationMessagesList();
/**
* Get the ID of the oldest message of
* the conversation
*
* @return The ID of the message / -1 in case of failure
*/
int getLastMessageID();
};
#endif // CONVERSATIONMESSAGESLIST_H