From bb3168169c29b0fff4ec9c9a1ec6ee4c26a4aff8 Mon Sep 17 00:00:00 2001 From: Lei OT Date: Mon, 5 Feb 2024 15:31:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=95=E7=94=A8=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lib/msgUtils.js | 4 ++-- src/views/Conversations/Components/InputComposer.jsx | 12 ++++++------ src/views/Conversations/Components/InputTemplate.jsx | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/lib/msgUtils.js b/src/lib/msgUtils.js index 8ab0865..989e934 100644 --- a/src/lib/msgUtils.js +++ b/src/lib/msgUtils.js @@ -31,9 +31,9 @@ export const sentMsgTypeMapped = { renderId: msg.id, to: msg.to, msgtype: 'text', - msgcontent: { body: msg.text, ...(msg.context ? { context: msg.context } : {}) }, + msgcontent: { body: msg.text, ...(msg.context ? { context: msg.context, message_origin: msg.message_origin } : {}) }, }), - contentToRender: (msg) => ({ ...msg, actionId: msg.id, conversationid: msg.id.split('.')[0], ...(msg.context ? { reply: { message: msg.context.message_origin.text, title: msg.context.message_origin.senderName || 'Reference' } } : {}) }), + contentToRender: (msg) => ({ ...msg, actionId: msg.id, conversationid: msg.id.split('.')[0], ...(msg.context ? { reply: { message: msg.message_origin.text, title: msg.message_origin.senderName || 'Reference' } } : {}) }), }, whatsappTemplate: { contentToSend: (msg) => ({ action: 'message', actionId: msg.id, renderId: msg.id, to: msg.to, msgtype: 'template', msgcontent: msg.template }), diff --git a/src/views/Conversations/Components/InputComposer.jsx b/src/views/Conversations/Components/InputComposer.jsx index 4bcf2cb..0ca4590 100644 --- a/src/views/Conversations/Components/InputComposer.jsx +++ b/src/views/Conversations/Components/InputComposer.jsx @@ -44,7 +44,7 @@ const InputBox = () => { id: `${currentConversation.sn}.${uuid()}`, // Date.now().toString(16), date: new Date(), status: 'waiting', - ...(referenceMsg.id ? { context: { message_id: referenceMsg.id, from: referenceMsg.from , message_origin: referenceMsg } } : {}), + ...(referenceMsg.id ? { context: { message_id: referenceMsg.id, }, message_origin: referenceMsg } : {}), }; invokeSendMessage(msgObj); setTextContent(''); @@ -77,12 +77,12 @@ const InputBox = () => { autoSize={{ minRows: 2, maxRows: 6 }} /> - + - {/*