Merge pull request #918 from judsonjuniorr/fix/validate-message-before-sending-chatwoot

Fix/validate message before sending chatwoot
This commit is contained in:
Davidson Gomes
2024-09-27 14:02:58 -03:00
committed by GitHub
2 changed files with 10 additions and 2 deletions

View File

@@ -890,6 +890,13 @@ export class ChatwootService {
sourceId?: string,
quotedMsg?: MessageModel,
) {
if (sourceId && this.isImportHistoryAvailable()) {
const messageAlreadySaved = await chatwootImport.getExistingSourceIds([sourceId]);
if (messageAlreadySaved.size > 0) {
this.logger.warn('Message already saved on chatwoot');
return null;
}
}
const data = new FormData();
if (content) {