|
|
|
@ -444,7 +444,7 @@ export const whatsappMsgTypeMapped = {
|
|
|
|
|
},
|
|
|
|
|
text: {
|
|
|
|
|
type: 'text',
|
|
|
|
|
data: (msg) => ({ id: msg.wamid, text: autoLinkText(msg?.text?.body), originText: msg?.text?.body, title: msg?.customerProfile?.name || msg?.from || '', idx: '--------------------------------------' }),
|
|
|
|
|
data: (msg) => ({ id: msg.wamid, text: autoLinkText(msg?.text?.body), originText: msg?.text?.body, title: msg?.customerProfile?.name || msg?.from || '', }),
|
|
|
|
|
renderForReply: (msg) => ({ id: msg.wamid, message: msg?.text?.body }),
|
|
|
|
|
},
|
|
|
|
|
image: {
|
|
|
|
@ -565,7 +565,7 @@ export const whatsappMsgTypeMapped = {
|
|
|
|
|
id: msg.wamid,
|
|
|
|
|
title: msg.document?.filename || '',
|
|
|
|
|
text: msg.document?.caption || msg.document?.filename || '',
|
|
|
|
|
data: { uri: msg.document.link, status: { click: false, download: true, loading: 0 } },
|
|
|
|
|
data: { uri: msg.document?.link, status: { click: false, download: true, loading: 0 } },
|
|
|
|
|
originText: msg.document?.caption || msg.document?.filename || '',
|
|
|
|
|
}),
|
|
|
|
|
renderForReply: (msg) => ({
|
|
|
|
@ -725,6 +725,7 @@ export const parseRenderMessageList = (messages) => {
|
|
|
|
|
msgOrigin: { ...msgContent, ...msgContent.email },
|
|
|
|
|
// id: msg.id || msgContent.wamid || msgContent.id,
|
|
|
|
|
...msgTypeData,
|
|
|
|
|
id: msgTypeData?.id || msg.sn,
|
|
|
|
|
type: msgContent.type,
|
|
|
|
|
...(typeof whatsappMsgTypeMapped[msgType].type === 'function' ? whatsappMsgTypeMapped[msgType].type(msg) : { type: whatsappMsgTypeMapped[msgType].type || 'text' }),
|
|
|
|
|
date: msg.msgtime, // msgContent?.sendTime || msg.msgtime || '',
|
|
|
|
@ -745,7 +746,7 @@ export const parseRenderMessageList = (messages) => {
|
|
|
|
|
dateString: msgStatusRenderMapped[msgContent?.status || 'failed'] === 'failed' ? `${(msg.msgtime || '').replace('T', ' ')} 发送失败 ${waError} ❌` : '',
|
|
|
|
|
statusCN: msgStatusRenderMappedCN[msgContent?.status || 'failed'],
|
|
|
|
|
statusTitle: msgStatusRenderMappedCN[msgContent?.status || 'failed'],
|
|
|
|
|
id: (msgContent?.status || 'failed') === 'failed' ? msgContent.actionId : (msgTypeData.id || msg.id),
|
|
|
|
|
id: (msgContent?.status || 'failed') === 'failed' ? msgContent.actionId : (msgTypeData.id || msg.id || msg.sn),
|
|
|
|
|
actionId: msgContent.actionId,
|
|
|
|
|
replyButton: !['waiting', 'failed'].includes(msgContent?.status || 'failed') ,
|
|
|
|
|
}
|
|
|
|
|