mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2026-01-09 05:12:28 -06:00
Merge remote-tracking branch 'refs/remotes/evo/develop'
# Conflicts: # prisma/mysql-schema.prisma # src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts
This commit is contained in:
@@ -1148,12 +1148,17 @@ export class BaileysStartupService extends ChannelStartupService {
|
||||
|
||||
this.sendDataWebhook(Events.CHATS_UPSERT, [chatToInsert]);
|
||||
if (this.configService.get<Database>('DATABASE').SAVE_DATA.CHATS) {
|
||||
await this.prismaRepository.chat.update({
|
||||
try {
|
||||
await this.prismaRepository.chat.update({
|
||||
where: {
|
||||
id: existingChat.id,
|
||||
},
|
||||
data: chatToInsert,
|
||||
});
|
||||
data: chatToInsert,
|
||||
});
|
||||
}
|
||||
catch(error){
|
||||
console.log(`Chat insert record ignored: ${chatToInsert.remoteJid} - ${chatToInsert.instanceId}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1487,12 +1492,17 @@ export class BaileysStartupService extends ChannelStartupService {
|
||||
|
||||
this.sendDataWebhook(Events.CHATS_UPSERT, [chatToInsert]);
|
||||
if (this.configService.get<Database>('DATABASE').SAVE_DATA.CHATS) {
|
||||
await this.prismaRepository.chat.update({
|
||||
try {
|
||||
await this.prismaRepository.chat.update({
|
||||
where: {
|
||||
id: existingChat.id,
|
||||
},
|
||||
data: chatToInsert,
|
||||
});
|
||||
data: chatToInsert,
|
||||
});
|
||||
}
|
||||
catch(error){
|
||||
console.log(`Chat insert record ignored: ${chatToInsert.remoteJid} - ${chatToInsert.instanceId}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4262,6 +4272,19 @@ export class BaileysStartupService extends ChannelStartupService {
|
||||
delete messageRaw.message.documentWithCaptionMessage;
|
||||
}
|
||||
|
||||
const quotedMessage = messageRaw?.contextInfo?.quotedMessage;
|
||||
if (quotedMessage) {
|
||||
if (quotedMessage.extendedTextMessage) {
|
||||
quotedMessage.conversation = quotedMessage.extendedTextMessage.text;
|
||||
delete quotedMessage.extendedTextMessage;
|
||||
}
|
||||
|
||||
if (quotedMessage.documentWithCaptionMessage) {
|
||||
quotedMessage.documentMessage = quotedMessage.documentWithCaptionMessage.message.documentMessage;
|
||||
delete quotedMessage.documentWithCaptionMessage;
|
||||
}
|
||||
}
|
||||
|
||||
return messageRaw;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user