|
|
@ -242,16 +242,17 @@ public class MessageHelper {
|
|
|
|
return TextUtils.join(", ", formatted);
|
|
|
|
return TextUtils.join(", ", formatted);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
String getHtml() throws MessagingException {
|
|
|
|
String getHtml() throws MessagingException, UnsupportedEncodingException {
|
|
|
|
return getHtml(imessage);
|
|
|
|
return getHtml(imessage);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private String getHtml(Part part) throws MessagingException {
|
|
|
|
private String getHtml(Part part) throws MessagingException, UnsupportedEncodingException {
|
|
|
|
if (part.isMimeType("text/*"))
|
|
|
|
if (part.isMimeType("text/*"))
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
String s;
|
|
|
|
String s = part.getContent().toString();
|
|
|
|
try {
|
|
|
|
if (part.isMimeType("text/plain"))
|
|
|
|
s = part.getContent().toString();
|
|
|
|
s = "<pre>" + s.replaceAll("\\r?\\n", "<br />") + "</pre>";
|
|
|
|
|
|
|
|
return s;
|
|
|
|
} catch (UnsupportedEncodingException ex) {
|
|
|
|
} catch (UnsupportedEncodingException ex) {
|
|
|
|
throw new UnsupportedEncodingException(part.getContentType());
|
|
|
|
throw new UnsupportedEncodingException(part.getContentType());
|
|
|
|
/*
|
|
|
|
/*
|
|
|
@ -270,11 +271,7 @@ public class MessageHelper {
|
|
|
|
Log.w(Helper.TAG, uex + "\n" + Log.getStackTraceString(uex));
|
|
|
|
Log.w(Helper.TAG, uex + "\n" + Log.getStackTraceString(uex));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (part.isMimeType("text/plain"))
|
|
|
|
|
|
|
|
s = "<pre>" + s.replaceAll("\\r?\\n", "<br />") + "</pre>";
|
|
|
|
|
|
|
|
return s;
|
|
|
|
|
|
|
|
} catch (IOException ex) {
|
|
|
|
} catch (IOException ex) {
|
|
|
|
Log.w(Helper.TAG, ex + "\n" + Log.getStackTraceString(ex));
|
|
|
|
Log.w(Helper.TAG, ex + "\n" + Log.getStackTraceString(ex));
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
@ -334,7 +331,8 @@ public class MessageHelper {
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private List<EntityAttachment> getAttachments(BodyPart part) throws IOException, MessagingException {
|
|
|
|
private List<EntityAttachment> getAttachments(BodyPart part) throws
|
|
|
|
|
|
|
|
IOException, MessagingException {
|
|
|
|
List<EntityAttachment> result = new ArrayList<>();
|
|
|
|
List<EntityAttachment> result = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
|
|
Object content = part.getContent();
|
|
|
|
Object content = part.getContent();
|
|
|
|