Issue 248

Issue 192

Do not remove markers for deleted messages, even if the corresponding
remote message is not returned by the remote store.  The remote
message may not be returned simply because the query did not encompass
it on this run.  If the account's delete policy is set to "Do not
delete from server", or the delete hasn't succeeded before a folder
refresh, a message for which the deleted marker has been removed can
errorneously reappear.

This will lead to the local store eventually having a large number of
deleted message markers.  In the long term, we'll need a way to manage
and possibly automatically remove them.
This commit is contained in:
Daniel Applebaum 2009-04-17 03:22:45 +00:00
parent 4ad4216de5
commit 47f5230bed
1 changed files with 4 additions and 2 deletions

View File

@ -875,7 +875,7 @@ s * critical data as fast as possible, and then we'll fill in the de
for (Message remoteMessage : remoteMessages) {
boolean messageChanged = false;
Message localMessage = localFolder.getMessage(remoteMessage.getUid());
if (localMessage == null) {
if (localMessage == null || localMessage.isSet(Flag.DELETED)) {
continue;
}
for (Flag flag : new Flag[] { Flag.SEEN, Flag.FLAGGED, Flag.ANSWERED } )
@ -914,7 +914,9 @@ s * critical data as fast as possible, and then we'll fill in the de
* Remove any messages that are in the local store but no longer on the remote store.
*/
for (Message localMessage : localMessages) {
if (remoteUidMap.get(localMessage.getUid()) == null) {
if (remoteUidMap.get(localMessage.getUid()) == null &&
!localMessage.isSet(Flag.DELETED))
{
localMessage.setFlag(Flag.X_DESTROYED, true);
for (MessagingListener l : getListeners()) {
l.synchronizeMailboxRemovedMessage(account, folder, localMessage);