1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-30 13:12:25 -05:00

Fixes Issue 1130

Fixes Issue 1308

Some IMAP servers seem not to provide an INTERNALDATE response.
This commit is contained in:
Daniel Applebaum 2010-04-14 13:02:04 +00:00
parent d90e4020be
commit 47a80fbd6c

View File

@ -1983,14 +1983,14 @@ public class MessagingController implements Runnable
remoteFolder.fetch(new Message[] { remoteMessage }, fp, null); remoteFolder.fetch(new Message[] { remoteMessage }, fp, null);
Date localDate = localMessage.getInternalDate(); Date localDate = localMessage.getInternalDate();
Date remoteDate = remoteMessage.getInternalDate(); Date remoteDate = remoteMessage.getInternalDate();
if (remoteDate.compareTo(localDate) > 0) if (remoteDate != null && remoteDate.compareTo(localDate) > 0)
{ {
/* /*
* If the remote message is newer than ours we'll just * If the remote message is newer than ours we'll just
* delete ours and move on. A sync will get the server message * delete ours and move on. A sync will get the server message
* if we need to be able to see it. * if we need to be able to see it.
*/ */
localMessage.setFlag(Flag.DELETED, true); localMessage.setFlag(Flag.X_DESTROYED, true);
} }
else else
{ {
@ -2011,11 +2011,14 @@ public class MessagingController implements Runnable
{ {
l.messageUidChanged(account, folder, oldUid, localMessage.getUid()); l.messageUidChanged(account, folder, oldUid, localMessage.getUid());
} }
remoteMessage.setFlag(Flag.DELETED, true); if (remoteDate != null)
if (Account.EXPUNGE_IMMEDIATELY.equals(account.getExpungePolicy())) {
{ remoteMessage.setFlag(Flag.DELETED, true);
remoteFolder.expunge(); if (Account.EXPUNGE_IMMEDIATELY.equals(account.getExpungePolicy()))
} {
remoteFolder.expunge();
}
}
} }
} }
} }