mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-26 10:28:38 -06:00
Update whatsapp.service.ts
This commit is contained in:
parent
fbd2184585
commit
d0c9259c9d
@ -2320,12 +2320,22 @@ 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 || mediaMessage.fileName )) {
|
||||
if (isURL(mediaMessage.media)) {
|
||||
mimetype = getMIMEType(mediaMessage.media);
|
||||
mimetype = getMIMEType(mediaMessage.media);
|
||||
} else {
|
||||
mimetype = getMIMEType(mediaMessage.fileName);
|
||||
mimetype = getMIMEType(mediaMessage.fileName);
|
||||
}
|
||||
} else {
|
||||
if (mediaMessage.mediatype === 'image') {
|
||||
mimetype = 'image/png';
|
||||
}
|
||||
if (mediaMessage.mediatype === 'video' {
|
||||
mimetype = 'video/mp4';
|
||||
}
|
||||
}
|
||||
// novo critério para adotar mimetype quando nao está presente na url e no filenemae - fim
|
||||
|
||||
this.logger.verbose('Mimetype: ' + mimetype);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user