mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-03 12:37:56 +00:00
fix: First attachment with caption for whatsapp channel (#6486)
This commit is contained in:
committed by
GitHub
parent
cd6a836bf6
commit
8935933266
@@ -968,15 +968,9 @@ export default {
|
|||||||
},
|
},
|
||||||
getMessagePayloadForWhatsapp(message) {
|
getMessagePayloadForWhatsapp(message) {
|
||||||
const multipleMessagePayload = [];
|
const multipleMessagePayload = [];
|
||||||
const messagePayload = {
|
|
||||||
conversationId: this.currentChat.id,
|
|
||||||
message,
|
|
||||||
private: false,
|
|
||||||
};
|
|
||||||
|
|
||||||
multipleMessagePayload.push(messagePayload);
|
|
||||||
|
|
||||||
if (this.attachedFiles && this.attachedFiles.length) {
|
if (this.attachedFiles && this.attachedFiles.length) {
|
||||||
|
let caption = message;
|
||||||
this.attachedFiles.forEach(attachment => {
|
this.attachedFiles.forEach(attachment => {
|
||||||
const attachedFile = this.globalConfig.directUploadsEnabled
|
const attachedFile = this.globalConfig.directUploadsEnabled
|
||||||
? attachment.blobSignedId
|
? attachment.blobSignedId
|
||||||
@@ -985,10 +979,18 @@ export default {
|
|||||||
conversationId: this.currentChat.id,
|
conversationId: this.currentChat.id,
|
||||||
files: [attachedFile],
|
files: [attachedFile],
|
||||||
private: false,
|
private: false,
|
||||||
message: '',
|
message: caption,
|
||||||
};
|
};
|
||||||
multipleMessagePayload.push(attachmentPayload);
|
multipleMessagePayload.push(attachmentPayload);
|
||||||
|
caption = '';
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
const messagePayload = {
|
||||||
|
conversationId: this.currentChat.id,
|
||||||
|
message,
|
||||||
|
private: false,
|
||||||
|
};
|
||||||
|
multipleMessagePayload.push(messagePayload);
|
||||||
}
|
}
|
||||||
|
|
||||||
return multipleMessagePayload;
|
return multipleMessagePayload;
|
||||||
|
|||||||
Reference in New Issue
Block a user