From fb774f2caa0ad9e4a3b12dd3b53e5d2d036b5bc5 Mon Sep 17 00:00:00 2001 From: devlikepro Date: Fri, 16 Aug 2024 11:47:55 +0700 Subject: [PATCH] [core] Adjust swagger for sendSeen fixed #485 --- src/core/engines/noweb/session.noweb.core.ts | 5 ++++- src/structures/chatting.dto.ts | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/core/engines/noweb/session.noweb.core.ts b/src/core/engines/noweb/session.noweb.core.ts index 8a78a23a..375df208 100644 --- a/src/core/engines/noweb/session.noweb.core.ts +++ b/src/core/engines/noweb/session.noweb.core.ts @@ -642,10 +642,13 @@ export class WhatsappSessionNoWebCore extends WhatsappSession { async sendSeen(request: SendSeenRequest) { const key = parseMessageId(request.messageId); + const participant = request.participant + ? toJID(this.ensureSuffix(request.participant)) + : undefined; const data = { remoteJid: key.remoteJid, id: key.id, - participant: request.participant, + participant: participant, }; return this.sock.readMessages([data]); } diff --git a/src/structures/chatting.dto.ts b/src/structures/chatting.dto.ts index dcfa6ddf..a12ce646 100644 --- a/src/structures/chatting.dto.ts +++ b/src/structures/chatting.dto.ts @@ -72,6 +72,7 @@ export class SendSeenRequest extends ChatRequest { @ApiProperty({ example: '11111111111@c.us', required: false, + default: null, description: 'NOWEB engine only - the ID of the user that sent the message (undefined for individual chats)', })