Fix unread for chat creation

This commit is contained in:
Jesus 2024-10-07 17:41:43 +02:00
parent edb3875b91
commit 27dc49f2c3

View File

@ -627,7 +627,12 @@ export class BaileysStartupService extends ChannelStartupService {
const chatsToInsert = chats const chatsToInsert = chats
.filter((chat) => !existingChatIdSet?.has(chat.id)) .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); this.sendDataWebhook(Events.CHATS_UPSERT, chatsToInsert);