mirror of https://github.com/M66B/FairEmail.git
Always guess attachment type
This commit is contained in:
parent
5032b15ee3
commit
661e2a6c97
|
@ -1117,14 +1117,13 @@ public class MessageHelper {
|
|||
|
||||
// Try to guess a better content type
|
||||
// For example, sometimes PDF files are sent as application/octet-stream
|
||||
if ("application/octet-stream".equalsIgnoreCase(apart.attachment.type)) {
|
||||
String extension = Helper.getExtension(apart.attachment.name);
|
||||
if (extension != null) {
|
||||
String type = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension.toLowerCase());
|
||||
if (type != null) {
|
||||
String extension = Helper.getExtension(apart.attachment.name);
|
||||
if (extension != null) {
|
||||
String type = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension.toLowerCase());
|
||||
if (type != null) {
|
||||
if (!type.equals(apart.attachment.type))
|
||||
Log.w("Guessing file=" + apart.attachment.name + " type=" + type);
|
||||
apart.attachment.type = type;
|
||||
}
|
||||
apart.attachment.type = type;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue