Refactoring

This commit is contained in:
M66B
2019-02-10 19:47:46 +00:00
parent 02696710ae
commit 9006f0ffe9
2 changed files with 18 additions and 4 deletions

View File

@@ -23,6 +23,8 @@ import android.content.Context;
import android.text.TextUtils;
import android.webkit.MimeTypeMap;
import com.sun.mail.imap.IMAPMessage;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
@@ -530,6 +532,18 @@ public class MessageHelper {
return (size < 0 ? null : size);
}
long getReceived() throws MessagingException {
if (imessage instanceof IMAPMessage)
return imessage.getReceivedDate().getTime();
else
return new Date().getTime();
}
Long getSent() throws MessagingException {
Date date = imessage.getSentDate();
return (date == null ? null : date.getTime());
}
String getHeaders() throws MessagingException {
StringBuilder sb = new StringBuilder();
Enumeration<Header> headers = imessage.getAllHeaders();