Get the correct unread count for a conversation

This commit is contained in:
Josh Perez 2021-05-10 14:49:13 -04:00 committed by GitHub
parent c68d65ea0b
commit 887b2c1db1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 47 additions and 14 deletions

View file

@ -167,6 +167,7 @@ const dataInterface: ClientInterface = {
saveMessages,
removeMessage,
removeMessages,
getUnreadCountForConversation,
getUnreadByConversationAndMarkRead,
getUnreadReactionsAndMarkRead,
markReactionAsRead,
@ -1046,6 +1047,10 @@ async function getMessageBySender(
return new Message(messages[0]);
}
async function getUnreadCountForConversation(conversationId: string) {
return channels.getUnreadCountForConversation(conversationId);
}
async function getUnreadByConversationAndMarkRead(
conversationId: string,
newestUnreadId: number,