diff --git a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts index cfe828fd..19aef748 100644 --- a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts +++ b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts @@ -627,7 +627,12 @@ export class BaileysStartupService extends ChannelStartupService { const chatsToInsert = chats .filter((chat) => !existingChatIdSet?.has(chat.id)) - .map((chat) => ({ remoteJid: chat.id, instanceId: this.instanceId, name: chat.name })); + .map((chat) => ({ + remoteJid: chat.id, + instanceId: this.instanceId, + name: chat.name, + unreadMessages: chat.unreadCount !== undefined ? chat.unreadCount : 0, + })); this.sendDataWebhook(Events.CHATS_UPSERT, chatsToInsert);