mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-03 05:34:51 +00:00
Correctly handle alternative text formats
This commit is contained in:
parent
9fde8fa0b5
commit
eedb0f34de
2 changed files with 6 additions and 5 deletions
1
FAQ.md
1
FAQ.md
|
@ -38,7 +38,6 @@ None at this moment.
|
||||||
* Automatically go to the next message on deleting a message: since the 'next' message can either be an older or a newer message this would be confusing. You can disable auto closing in the advanced options and use the bottom navigation bar instead.
|
* Automatically go to the next message on deleting a message: since the 'next' message can either be an older or a newer message this would be confusing. You can disable auto closing in the advanced options and use the bottom navigation bar instead.
|
||||||
* Rich text editor: besides that very few people would use this on a small mobile device, Android doesn't support a rich text editor and most rich text editor open source projects are abandoned.
|
* Rich text editor: besides that very few people would use this on a small mobile device, Android doesn't support a rich text editor and most rich text editor open source projects are abandoned.
|
||||||
* Widget to read e-mail: widgets can have limited user interaction only, so a widget to read e-mail would not be very useful. Moreover, it would be not very useful to duplicate functions which are already available in the app.
|
* Widget to read e-mail: widgets can have limited user interaction only, so a widget to read e-mail would not be very useful. Moreover, it would be not very useful to duplicate functions which are already available in the app.
|
||||||
* Calendar events: opening the attached calendar file should open the related calendar app.
|
|
||||||
* Executing filter rules: filter rules should be executed on the server because a battery powered device with possibly an unstable internet connection is not suitable for this.
|
* Executing filter rules: filter rules should be executed on the server because a battery powered device with possibly an unstable internet connection is not suitable for this.
|
||||||
* Badge count: there is no standard Android API for this and third party solutions might stop working anytime. For example *ShortcutBadger* [has lots of problems](https://github.com/leolin310148/ShortcutBadger/issues). You can use the provided widget instead.
|
* Badge count: there is no standard Android API for this and third party solutions might stop working anytime. For example *ShortcutBadger* [has lots of problems](https://github.com/leolin310148/ShortcutBadger/issues). You can use the provided widget instead.
|
||||||
* Switch language: although it is possible to change the language of an app, Android is not designed for this. Better fix the translation in your language if needed, see [this FAQ](#user-content-faq26) about how to.
|
* Switch language: although it is possible to change the language of an app, Android is not designed for this. Better fix the translation in your language if needed, see [this FAQ](#user-content-faq26) about how to.
|
||||||
|
|
|
@ -519,7 +519,7 @@ public class MessageHelper {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String getHtml(Part part) throws MessagingException, IOException {
|
private static String getHtml(Part part) throws MessagingException, IOException {
|
||||||
if (part.isMimeType("text/*")) {
|
if (part.isMimeType("text/plain") || part.isMimeType("text/html")) {
|
||||||
String s;
|
String s;
|
||||||
try {
|
try {
|
||||||
Object content = part.getContent();
|
Object content = part.getContent();
|
||||||
|
@ -654,7 +654,7 @@ public class MessageHelper {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Part.ATTACHMENT.equalsIgnoreCase(disposition) ||
|
if (Part.ATTACHMENT.equalsIgnoreCase(disposition) ||
|
||||||
part.isMimeType("image/*") ||
|
!(part.isMimeType("text/plain") || part.isMimeType("text/html")) ||
|
||||||
!TextUtils.isEmpty(filename)) {
|
!TextUtils.isEmpty(filename)) {
|
||||||
ContentType ct = new ContentType(part.getContentType());
|
ContentType ct = new ContentType(part.getContentType());
|
||||||
String[] cid = part.getHeader("Content-ID");
|
String[] cid = part.getHeader("Content-ID");
|
||||||
|
@ -668,10 +668,12 @@ public class MessageHelper {
|
||||||
attachment.encryption = (pgp ? EntityAttachment.PGP_MESSAGE : null);
|
attachment.encryption = (pgp ? EntityAttachment.PGP_MESSAGE : null);
|
||||||
attachment.part = part;
|
attachment.part = part;
|
||||||
|
|
||||||
|
if (TextUtils.isEmpty(attachment.name) && "text/calendar".equals(attachment.type))
|
||||||
|
attachment.name = "invite.ics";
|
||||||
|
|
||||||
// Try to guess a better content type
|
// Try to guess a better content type
|
||||||
// Sometimes PDF files are sent using the wrong type
|
// Sometimes PDF files are sent using the wrong type
|
||||||
if ("application/octet-stream".equals(attachment.type) ||
|
if ("application/octet-stream".equals(attachment.type)) {
|
||||||
"message/disposition-notification".equals(attachment.type)) {
|
|
||||||
String extension = Helper.getExtension(attachment.name);
|
String extension = Helper.getExtension(attachment.name);
|
||||||
if (extension != null) {
|
if (extension != null) {
|
||||||
String type = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension.toLowerCase());
|
String type = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension.toLowerCase());
|
||||||
|
|
Loading…
Reference in a new issue