Prefer Date header over INTERNALDATE

Servers have so many bugs, does nobody pay attention?
This commit is contained in:
M66B 2019-11-15 22:09:09 +01:00
parent 679eb92f74
commit d1c2a688df
1 changed files with 10 additions and 0 deletions

View File

@ -772,6 +772,16 @@ public class MessageHelper {
}
long getReceived() throws MessagingException {
String date = imessage.getHeader("Date", null);
if (date != null) {
try {
Date received = new MailDateFormat().parse(date);
Log.i("Parsed received=" + received);
return received.getTime();
} catch (java.text.ParseException ignored) {
}
}
Date received = imessage.getReceivedDate();
if (received == null)
received = imessage.getSentDate();