Can get older conversation messages

This commit is contained in:
2019-01-10 03:29:22 +01:00
parent 22eec97796
commit bdfbe8ba48
7 changed files with 88 additions and 1 deletions

View File

@ -5,6 +5,14 @@ ConversationMessagesList::ConversationMessagesList()
}
int ConversationMessagesList::getOldestMessageID()
{
if(count() == 0)
return -1;
return at(0).iD();
}
int ConversationMessagesList::getLastMessageID()
{

View File

@ -16,6 +16,13 @@ class ConversationMessagesList : public QList<ConversationMessage>
public:
ConversationMessagesList();
/**
* Get and return the oldest message of the conversation
*
* @return The ID of the oldest message / -1 if none found
*/
int getOldestMessageID();
/**
* Get the ID of the newest message of
* the conversation