fix(chat): default the read cursor to 0 when counting unread #10
@@ -111,9 +111,9 @@ export const registerChatRoutes = (app: App, db: Db, config: Config): void => {
|
||||
AND m.user_id <> ?
|
||||
WHERE f.deleted_at IS NULL
|
||||
AND m.id > COALESCE (
|
||||
SELECT cr.last_read_message_id
|
||||
FROM chat_reads cr
|
||||
WHERE cr.folder_id = f.id AND cr.user_id = ? )
|
||||
( SELECT cr.last_read_message_id
|
||||
FROM chat_reads cr
|
||||
WHERE cr.folder_id = f.id AND cr.user_id = ? ), 0 )
|
||||
AND ${READ_SQL}
|
||||
GROUP BY f.id
|
||||
HAVING unread > 0`,
|
||||
|
||||
Reference in New Issue
Block a user