mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-21 19:47:21 -06:00
Fix unread for chat creation
This commit is contained in:
parent
edb3875b91
commit
27dc49f2c3
@ -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);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user