mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 20:26:24 +00:00
Always update unreadCount for conversations
This commit is contained in:
committed by
Scott Nonnenberg
parent
794d910d4e
commit
215d90fbe8
@@ -3215,7 +3215,8 @@ async function getUnreadCountForConversation(
|
||||
`
|
||||
SELECT COUNT(*) AS unreadCount FROM messages
|
||||
WHERE unread = 1 AND
|
||||
conversationId = $conversationId
|
||||
conversationId = $conversationId AND
|
||||
type = 'incoming';
|
||||
`
|
||||
)
|
||||
.get({
|
||||
@@ -3346,12 +3347,17 @@ async function getUnreadReactionsAndMarkRead(
|
||||
newestUnreadId,
|
||||
});
|
||||
|
||||
db.exec(`
|
||||
db.prepare(
|
||||
`
|
||||
UPDATE reactions SET
|
||||
unread = 0 WHERE
|
||||
$conversationId = conversationId AND
|
||||
$messageReceivedAt <= messageReceivedAt;
|
||||
`);
|
||||
conversationId = $conversationId AND
|
||||
messageReceivedAt <= $newestUnreadId;
|
||||
`
|
||||
).run({
|
||||
conversationId,
|
||||
newestUnreadId,
|
||||
});
|
||||
|
||||
return unreadMessages;
|
||||
})();
|
||||
@@ -3385,8 +3391,8 @@ async function markReactionAsRead(
|
||||
`
|
||||
UPDATE reactions SET
|
||||
unread = 0 WHERE
|
||||
$targetAuthorUuid = targetAuthorUuid AND
|
||||
$targetTimestamp = targetTimestamp;
|
||||
targetAuthorUuid = $targetAuthorUuid AND
|
||||
targetTimestamp = $targetTimestamp;
|
||||
`
|
||||
).run({
|
||||
targetAuthorUuid,
|
||||
|
||||
Reference in New Issue
Block a user