backend: per-conversation unread counts

Count messages from others newer than the caller's read pointer alongside the
existing last-message lookup, expose it as unreadCount on
ConversationSummary, and derive the unread boolean from it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Khalid Abdi
2026-06-11 21:04:12 +03:00
parent 09745b8fdd
commit f550f4cbd7
2 changed files with 22 additions and 9 deletions
+2
View File
@@ -21,5 +21,7 @@ export type ConversationSummary = {
participants: Participant[];
lastMessage: ConversationMessage | null;
unread: boolean;
// Messages from others newer than the caller's read pointer.
unreadCount: number;
updatedAt: string;
};