Skip to content

Commit 27dc49f

Browse files
author
Jesus
committed
Fix unread for chat creation
1 parent edb3875 commit 27dc49f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,12 @@ export class BaileysStartupService extends ChannelStartupService {
627627

628628
const chatsToInsert = chats
629629
.filter((chat) => !existingChatIdSet?.has(chat.id))
630-
.map((chat) => ({ remoteJid: chat.id, instanceId: this.instanceId, name: chat.name }));
630+
.map((chat) => ({
631+
remoteJid: chat.id,
632+
instanceId: this.instanceId,
633+
name: chat.name,
634+
unreadMessages: chat.unreadCount !== undefined ? chat.unreadCount : 0,
635+
}));
631636

632637
this.sendDataWebhook(Events.CHATS_UPSERT, chatsToInsert);
633638

0 commit comments

Comments
 (0)