fix: OUT messages no longer create unread status + handle Telegram read receipts
Only inbound (IN) messages determine hasUnread in getContacts(). Telegram read_business_message events are now parsed and processed to auto-mark contacts as read for the entire team. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -426,7 +426,7 @@ async function getContacts(auth: AuthContext | null) {
|
||||
include: {
|
||||
note: { select: { content: true } },
|
||||
messages: {
|
||||
...(messageWhere ? { where: messageWhere } : {}),
|
||||
where: { direction: "IN", ...(messageWhere ?? {}) },
|
||||
select: { content: true, channel: true, occurredAt: true },
|
||||
orderBy: { occurredAt: "desc" as const },
|
||||
take: 1,
|
||||
|
||||
Reference in New Issue
Block a user