From 801de4cb9610d631b1a35a6e8897921006adff92 Mon Sep 17 00:00:00 2001 From: LiaoYijun Date: Wed, 8 Jan 2025 08:55:00 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E5=9B=BE=E7=89=87=E5=92=8C=E6=96=87?= =?UTF-8?q?=E6=9C=AC=E6=B6=88=E6=81=AF=E7=BB=9F=E4=B8=80=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wai-server/core/baileys/index.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/wai-server/core/baileys/index.js b/wai-server/core/baileys/index.js index 0f3c162..7144439 100644 --- a/wai-server/core/baileys/index.js +++ b/wai-server/core/baileys/index.js @@ -93,6 +93,7 @@ const createWhatsApp = async phone => { const msgDirection = msg.key.fromMe ? 'outbound' : 'inbound'; const msgFrom = msg.key.fromMe ? whatsAppNo : remoteNo; const msgTo = msg.key.fromMe ? remoteNo : whatsAppNo; + const msgStatus = msg.status === undefined ? '' : formatStatus(msg.status); if (msg.message?.conversation || msg.message?.extendedTextMessage?.text) { @@ -101,7 +102,7 @@ const createWhatsApp = async phone => { waEmitter.emit(emitEventName, { id: msg.key.id, externalId, - status: formatStatus(msg.status), + status: msgStatus, direction: msgDirection, from: msgFrom, to: msgTo, @@ -131,8 +132,6 @@ const createWhatsApp = async phone => { const imageFilename = './temp/image_' + whatsAppNo + '_' + msg.key.id + fileExtension; await writeFile(imageFilename, imageBuffer); - const msgStatus = msg.status === undefined ? '' : formatStatus(msg.status); - waEmitter.emit(emitEventName, { id: msg.key.id, externalId,