From 769fa7683152fb396c8ed9d6d81f98989d6c0fff Mon Sep 17 00:00:00 2001 From: Lei OT Date: Mon, 19 May 2025 14:16:32 +0800 Subject: [PATCH] perf(WAI): outbound Status --- wai-server/core/handler/whatsappHandler.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wai-server/core/handler/whatsappHandler.js b/wai-server/core/handler/whatsappHandler.js index cf7e11b..bccd86f 100644 --- a/wai-server/core/handler/whatsappHandler.js +++ b/wai-server/core/handler/whatsappHandler.js @@ -71,7 +71,8 @@ const uniqueMsgId = msg => (msg.id && msg.direction ? `${directionPrefix[msg.dir */ const webhookBodyBuilder = (messageData, messageType) => { const defaultContent = { id: '', from: '', to: '', externalId: '', type: '', direction: '', status: '' }; - const status = messageData.direction === 'inbound' ? '' : statusMapped?.[messageData.status] || messageData.status || ''; + const outboundStatus = statusMapped?.[messageData.status] || messageData.status || ''; + const status = messageData.direction === 'inbound' ? '' : outboundStatus; const errors = messageData.status === 'error' ? { errorMessage: '未知错误', errorCode: '' } : {}; const message = { id: `evt_${generateId().replace(/-/g, '')}`,