Skip to content

Commit

Permalink
Merge pull request #133 from francisbreit/fetch-instances
Browse files Browse the repository at this point in the history
Correção de nao recebimento de midias armazenadas mo minio/s3 Update whatsapp.service.ts
  • Loading branch information
DavidsonGomes authored Sep 28, 2023
2 parents 50be69f + b648334 commit f6b6d23
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions src/whatsapp/services/whatsapp.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2308,22 +2308,36 @@ export class WAStartupService {
mediaMessage.fileName = arrayMatch[1];
this.logger.verbose('File name: ' + mediaMessage.fileName);
}
// *inserido francis inicio
let mimetype: string;
// *inserido francis final


if (mediaMessage.mediatype === 'image' && !mediaMessage.fileName) {
mediaMessage.fileName = 'image.png';
// inserido francis inicio
mimetype = 'image/png';
// inserido francis inicio

}

if (mediaMessage.mediatype === 'video' && !mediaMessage.fileName) {
mediaMessage.fileName = 'video.mp4';
// inserido francis inicio
mimetype = 'video/mp4';
// inserido francis final
}

let mimetype: string;
// ocultado francis inicio
// let mimetype: string;

if (isURL(mediaMessage.media)) {
mimetype = getMIMEType(mediaMessage.media);
} else {
mimetype = getMIMEType(mediaMessage.fileName);
}

// if (isURL(mediaMessage.media)) {
// mimetype = getMIMEType(mediaMessage.media);
// } else {
// mimetype = getMIMEType(mediaMessage.fileName);
// }
// ocultado francis final

this.logger.verbose('Mimetype: ' + mimetype);

Expand Down

0 comments on commit f6b6d23

Please sign in to comment.