Added logging

This commit is contained in:
M66B 2022-07-19 08:11:50 +02:00
parent 4324d22585
commit ac3ac4330f
1 changed files with 11 additions and 1 deletions

View File

@ -4258,9 +4258,10 @@ public class MessageHelper {
try {
Log.d("Part class=" + part.getClass() + " type=" + part.getContentType());
// https://github.com/autocrypt/protected-headers
try {
ContentType ct = new ContentType(part.getContentType());
// https://github.com/autocrypt/protected-headers
if ("v1".equals(ct.getParameter("protected-headers"))) {
String[] subject = part.getHeader("subject");
if (subject != null && subject.length != 0) {
@ -4268,6 +4269,15 @@ public class MessageHelper {
parts.protected_subject = decodeMime(subject[0]);
}
}
// https://en.wikipedia.org/wiki/MIME#Multipart_subtypes
if ("multipart".equals(ct.getPrimaryType()) &&
!("mixed".equalsIgnoreCase(ct.getSubType()) ||
"alternative".equalsIgnoreCase(ct.getSubType()) ||
"related".equalsIgnoreCase(ct.getSubType()) ||
"report".equalsIgnoreCase(ct.getSubType()))) {
Log.e(part.getContentType());
}
} catch (Throwable ex) {
Log.e(ex);
}