1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-12-26 01:28:50 -05:00

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

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) { for (Message remoteMessage : remoteMessages) {
boolean messageChanged = false; boolean messageChanged = false;
Message localMessage = localFolder.getMessage(remoteMessage.getUid()); Message localMessage = localFolder.getMessage(remoteMessage.getUid());
if (localMessage == null) { if (localMessage == null || localMessage.isSet(Flag.DELETED)) {
continue; continue;
} }
for (Flag flag : new Flag[] { Flag.SEEN, Flag.FLAGGED, Flag.ANSWERED } ) 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. * Remove any messages that are in the local store but no longer on the remote store.
*/ */
for (Message localMessage : localMessages) { 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); localMessage.setFlag(Flag.X_DESTROYED, true);
for (MessagingListener l : getListeners()) { for (MessagingListener l : getListeners()) {
l.synchronizeMailboxRemovedMessage(account, folder, localMessage); l.synchronizeMailboxRemovedMessage(account, folder, localMessage);