conversation: store last displayed messages

With this patch, the daemon is now storing informations based
on setMessageDisplayed/onMessageDisplayed to follow the read
status per participant.

This avoid to creates a logic in all clients and allow the client
to have a correct read status even if the daemon was launched
separately.
Clients can now:

+ Retrieve last displayed interactions by retrieving members infos
(via getConversationMembers() and the key "lastDisplayed")
+ Know how many messages there between the head and a commit. This
is useful to count unread messages for a peer.

GitLab: #592
Change-Id: I0b5bc7adb5cda48754f33a362a40ce10ee345e3c
This commit is contained in:
Sébastien Blin
2021-07-21 16:40:46 -04:00
parent bd3eba9dc4
commit f457b73fab
16 changed files with 239 additions and 8 deletions

View File

@ -57,6 +57,7 @@ namespace DRing {
// Message send/load
void sendMessage(const std::string& accountId, const std::string& conversationId, const std::string& message, const std::string& parent);
uint32_t loadConversationMessages(const std::string& accountId, const std::string& conversationId, const std::string& fromMessage, size_t n);
uint32_t countInteractions(const std::string& accountId, const std::string& conversationId, const std::string& toId, const std::string& fromId);
}