|
|
|
@ -648,11 +648,7 @@ export const parseRenderMessageList = (messages) => {
|
|
|
|
|
sender: msgContent.from,
|
|
|
|
|
senderName: msgContent?.customerProfile?.name || 'me', // msgContent.from,
|
|
|
|
|
replyButton: ['text', 'document', 'image', 'email'].includes(msgContent.type) && (msgContent?.status || '') !== 'failed',
|
|
|
|
|
// 用forwarded表示Resend, 与Reply互斥 // debug: email, failed
|
|
|
|
|
forwarded: msg.msg_direction === 'outbound'
|
|
|
|
|
&& msg.msg_source === 'email'
|
|
|
|
|
&& ['email'].includes(msgContent.type)
|
|
|
|
|
&& (msgContent?.status || 'failed') === 'failed',
|
|
|
|
|
forwarded: ['text', 'email'].includes(msgContent.type) && (msgContent?.status || 'failed') === 'failed', // 用forwarded表示Resend, 与Reply互斥 // debug: email, failed
|
|
|
|
|
...(msg.msg_direction === 'outbound'
|
|
|
|
|
? {
|
|
|
|
|
sender: 'me',
|
|
|
|
@ -663,18 +659,18 @@ export const parseRenderMessageList = (messages) => {
|
|
|
|
|
statusTitle: msgStatusRenderMappedCN[msgContent?.status || 'failed'],
|
|
|
|
|
}
|
|
|
|
|
: {}),
|
|
|
|
|
...(isEmpty(messageorigin) && (isEmpty(msgContent.context) || msgContent.context?.forwarded === true)
|
|
|
|
|
? // ...((isEmpty(msg.context) && isEmpty(msg.reaction)) || msg.context?.forwarded === true || isEmpty(messageorigin)
|
|
|
|
|
...((isEmpty(messageorigin) && (isEmpty(msgContent.context) || msgContent.context?.forwarded === true))
|
|
|
|
|
// ...((isEmpty(msg.context) && isEmpty(msg.reaction)) || msg.context?.forwarded === true || isEmpty(messageorigin)
|
|
|
|
|
// ...((isEmpty(messageorigin) || isEmpty(msgContent.context))
|
|
|
|
|
{}
|
|
|
|
|
? {}
|
|
|
|
|
: {
|
|
|
|
|
reply: {
|
|
|
|
|
message: messageorigin?.text?.body || messageorigin?.text,
|
|
|
|
|
title: messageorigin?.customerProfile?.name || messageorigin?.senderName || 'me',
|
|
|
|
|
...(typeof whatsappMsgTypeMapped[messageorigin?.type || 'unsupported']?.renderForReply === 'function'
|
|
|
|
|
? whatsappMsgTypeMapped[messageorigin?.type || 'unsupported'].renderForReply(messageorigin)
|
|
|
|
|
...(typeof whatsappMsgTypeMapped[(messageorigin?.type || 'unsupported')]?.renderForReply === 'function'
|
|
|
|
|
? whatsappMsgTypeMapped[(messageorigin?.type || 'unsupported')].renderForReply(messageorigin)
|
|
|
|
|
: {}),
|
|
|
|
|
titleColor: messageorigin?.customerProfile?.name ? '#a791ff' : '#128c7e',
|
|
|
|
|
titleColor: messageorigin?.customerProfile?.name ? '#a791ff' : "#128c7e",
|
|
|
|
|
// titleColor: msg.messageorigin_direction === 'inbound' ? '#a791ff' : "#128c7e",
|
|
|
|
|
id: msgContent.context?.id || msgContent.context?.message_id || msgContent.reaction?.message_id || messageorigin?.wamid,
|
|
|
|
|
},
|
|
|
|
@ -683,7 +679,7 @@ export const parseRenderMessageList = (messages) => {
|
|
|
|
|
// conversationid: conversationid,
|
|
|
|
|
// title: msg.customerProfile.name,
|
|
|
|
|
whatsapp_msg_type: (msg.msg_source || 'WABA') === 'WABA' ? msgContent.type : '', // 1.0接口没有msg_source
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
export const whatsappError = {
|
|
|
|
|