From 57e74ff2275cda6f8b93a2953d64a08f67d03a95 Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 4 Oct 2020 12:17:37 +0200 Subject: [PATCH] Is TNEF --- app/src/main/java/eu/faircode/email/Helper.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/Helper.java b/app/src/main/java/eu/faircode/email/Helper.java index 674e327cfd..2ad39a921f 100644 --- a/app/src/main/java/eu/faircode/email/Helper.java +++ b/app/src/main/java/eu/faircode/email/Helper.java @@ -517,7 +517,7 @@ public class Helper { // Check if viewer available if (ris == null || ris.size() == 0) { - if ("application/ms-tnef".equals(type)) + if (isTnef(type)) viewFAQ(context, 155); else { String message = context.getString(R.string.title_no_viewer, @@ -530,7 +530,7 @@ public class Helper { try { context.startActivity(intent); } catch (ActivityNotFoundException ex) { - if ("application/ms-tnef".equals(type)) + if (isTnef(type)) viewFAQ(context, 155); else { String message = context.getString(R.string.title_no_viewer, @@ -541,6 +541,12 @@ public class Helper { } } + private static boolean isTnef(String type) { + // https://en.wikipedia.org/wiki/Transport_Neutral_Encapsulation_Format + return ("application/ms-tnef".equals(type) || + "application/vnd.ms-tnef".equals(type)); + } + static void view(Context context, Intent intent) { Uri uri = intent.getData(); if ("http".equals(uri.getScheme()) || "https".equals(uri.getScheme()))