1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-23 09:52:16 -05:00

Added support for propagating "Deleted" flags back to IMAP servers.

* Fixed a typo in original method names (really should have been another commit, but this is the initial upload)
This commit is contained in:
Jesse Vincent 2008-10-28 01:11:05 +00:00
parent ffd7766384
commit 822b3b3daa

View File

@ -336,7 +336,7 @@ public class MessagingController implements Runnable {
}
put("synchronizeMailbox", listener, new Runnable() {
public void run() {
synchronizeMailboxSyncronous(account, folder);
synchronizeMailboxSynchronous(account, folder);
}
});
}
@ -353,7 +353,7 @@ public class MessagingController implements Runnable {
*
* TODO Break this method up into smaller chunks.
*/
public void synchronizeMailboxSyncronous(final Account account, final String folder) {
public void synchronizeMailboxSynchronous(final Account account, final String folder) {
for (MessagingListener l : mListeners) {
l.synchronizeMailboxStarted(account, folder);
}
@ -421,9 +421,6 @@ public class MessagingController implements Runnable {
*/
remoteFolder.open(OpenMode.READ_WRITE);
/*
* Trash any remote messages that are marked as trashed locally.
*/
/*
* Get the remote message count.
@ -447,6 +444,12 @@ public class MessagingController implements Runnable {
remoteUidMap.put(message.getUid(), message);
}
/*
* Get a list of the messages that are in the remote list but not on the
* local store, or messages that are in the local store but failed to download
@ -455,13 +458,28 @@ public class MessagingController implements Runnable {
for (Message message : remoteMessages) {
Message localMessage = localUidMap.get(message.getUid());
if (localMessage == null ||
(!localMessage.isSet(Flag.X_DOWNLOADED_FULL) &&
(!localMessage.isSet(Flag.DELETED) &&
!localMessage.isSet(Flag.X_DOWNLOADED_FULL) &&
!localMessage.isSet(Flag.X_DOWNLOADED_PARTIAL))) {
unsyncedMessages.add(message);
}
}
}
/*
* Trash any remote messages that are marked as trashed locally.
*/
for (Message message : localMessages) {
Message remoteMessage = remoteUidMap.get(message.getUid());
// skip things deleted on the server side
if (remoteMessage != null && message.isSet(Flag.DELETED)) {
remoteMessage.setFlag(Flag.DELETED, true);
}
}
/*
* A list of messages that were downloaded and which did not have the Seen flag set.
* This will serve to indicate the true "new" message count that will be reported to
@ -1414,7 +1432,7 @@ s * critical data as fast as possible, and then we'll fill in the de
}
for (Account account : accounts) {
sendPendingMessagesSynchronous(account);
synchronizeMailboxSyncronous(account, Email.INBOX);
synchronizeMailboxSynchronous(account, Email.INBOX);
}
for (MessagingListener l : mListeners) {
l.checkMailFinished(context, account);