Optimize updating call unread count
This commit is contained in:
parent
67252866cf
commit
c901708281
4 changed files with 48 additions and 5 deletions
|
@ -3624,7 +3624,7 @@ const FOUR_HOURS_IN_MS = sqlConstant(4 * 60 * 60 * 1000);
|
|||
function getCallHistoryUnreadCount(db: ReadableDB): number {
|
||||
const [query, params] = sql`
|
||||
SELECT count(*) FROM messages
|
||||
LEFT JOIN callsHistory ON callsHistory.callId = messages.callId
|
||||
INNER JOIN callsHistory ON callsHistory.callId = messages.callId
|
||||
WHERE messages.type IS 'call-history'
|
||||
AND messages.seenStatus IS ${SEEN_STATUS_UNSEEN}
|
||||
AND callsHistory.status IS ${CALL_STATUS_MISSED}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue