Update whatsapp.service.ts

This commit is contained in:
Francis Breit 2023-10-01 18:30:00 -03:00 committed by GitHub
parent 573f2cde51
commit bc83ec53ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2321,19 +2321,11 @@ export class WAStartupService {
let mimetype: string;
// novo critério para adotar mimetype quando nao está presente na url e no filenemae - inicio
if (isURL(mediaMessage.media) {
if (isURL(mediaMessage.media) {
mimetype = getMIMEType(mediaMessage.media);
} else {
mimetype = getMIMEType(mediaMessage.fileName);
}
} else {
if (mediaMessage.mediatype === 'image') {
mimetype = 'image/png';
}
if (mediaMessage.mediatype === 'video') {
mimetype = 'video/mp4';
}
if (isURL(mediaMessage.media)) {
mimetype = getMIMEType(mediaMessage.media);
} else {
mimetype = getMIMEType(mediaMessage.fileName);
}
// novo critério para adotar mimetype quando nao está presente na url e no filenemae - fim
this.logger.verbose('Mimetype: ' + mimetype);