|
|
@ -202,6 +202,17 @@ public class EntityAttachment {
|
|
|
|
if (encryption != null)
|
|
|
|
if (encryption != null)
|
|
|
|
return type;
|
|
|
|
return type;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ("audio/mid".equals(type))
|
|
|
|
|
|
|
|
return "audio/midi";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// https://www.rfc-editor.org/rfc/rfc3555.txt
|
|
|
|
|
|
|
|
if ("image/jpg".equals(type) || "video/jpeg".equals(type))
|
|
|
|
|
|
|
|
return "image/jpeg";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!TextUtils.isEmpty(type) &&
|
|
|
|
|
|
|
|
(type.endsWith("/pdf") || type.endsWith("/x-pdf")))
|
|
|
|
|
|
|
|
return "application/pdf";
|
|
|
|
|
|
|
|
|
|
|
|
String extension = Helper.getExtension(name);
|
|
|
|
String extension = Helper.getExtension(name);
|
|
|
|
if (extension == null)
|
|
|
|
if (extension == null)
|
|
|
|
return type;
|
|
|
|
return type;
|
|
|
@ -300,17 +311,6 @@ public class EntityAttachment {
|
|
|
|
if ("text/plain".equals(type) && "ovpn".equals(extension))
|
|
|
|
if ("text/plain".equals(type) && "ovpn".equals(extension))
|
|
|
|
return "application/x-openvpn-profile";
|
|
|
|
return "application/x-openvpn-profile";
|
|
|
|
|
|
|
|
|
|
|
|
if ("audio/mid".equals(type))
|
|
|
|
|
|
|
|
return "audio/midi";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// https://www.rfc-editor.org/rfc/rfc3555.txt
|
|
|
|
|
|
|
|
if ("image/jpg".equals(type) || "video/jpeg".equals(type))
|
|
|
|
|
|
|
|
return "image/jpeg";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!TextUtils.isEmpty(type) &&
|
|
|
|
|
|
|
|
(type.endsWith("/pdf") || type.endsWith("/x-pdf")))
|
|
|
|
|
|
|
|
return "application/pdf";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Guess types
|
|
|
|
// Guess types
|
|
|
|
if (gtype != null) {
|
|
|
|
if (gtype != null) {
|
|
|
|
if (TextUtils.isEmpty(type) ||
|
|
|
|
if (TextUtils.isEmpty(type) ||
|
|
|
|