mirror of
https://gitlab.com/comunic/comunicmessages
synced 2025-06-20 08:55:17 +00:00
Automatically fetch new messages.
This commit is contained in:
16
data/conversationmessageslist.cpp
Normal file
16
data/conversationmessageslist.cpp
Normal 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();
|
||||
}
|
28
data/conversationmessageslist.h
Normal file
28
data/conversationmessageslist.h
Normal 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
|
Reference in New Issue
Block a user