1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-23 18:02:15 -05:00

Restore ability for FolderMessageList "Refresh" to get a new list of

folders

Automatically clean up deleted messages in Outbox (make deleted
messages destroyed); don't try to send deleted messages, destroy
messages in outbox when deleting.  (Yep, the first and third items are
redundant, but will automatically clean up damaged outboxes)
This commit is contained in:
Daniel Applebaum 2009-01-09 05:39:43 +00:00
parent a81facc6e7
commit 95c47fcddc

View File

@ -269,7 +269,7 @@ public class MessagingController implements Runnable {
Store localStore = Store.getInstance(account.getLocalStoreUri(), mApplication);
Folder[] localFolders = localStore.getPersonalNamespaces();
if ( localFolders == null || localFolders.length == 0) {
if ( refreshRemote || localFolders == null || localFolders.length == 0) {
doRefreshRemote(account, listener);
return;
}
@ -1795,6 +1795,10 @@ s * critical data as fast as possible, and then we'll fill in the de
Transport transport = Transport.getInstance(account.getTransportUri());
for (Message message : localMessages) {
if (message.isSet(Flag.DELETED)) {
message.setFlag(Flag.X_DESTROYED, true);
continue;
}
try {
localFolder.fetch(new Message[] { message }, fp, null);
try {
@ -1903,9 +1907,14 @@ s * critical data as fast as possible, and then we'll fill in the de
// TODO: Turn the fetch/copy/delete into an atomic move
localFolder.fetch(new Message[] { message }, fp, null);
localFolder.copyMessages(new Message[] { message }, localTrashFolder);
if (folder.equals(account.getOutboxFolderName())) {
message.setFlag(Flag.X_DESTROYED, true);
}
else {
message.setFlag(Flag.DELETED, true);
}
}
}
if (listener != null) {
listener.messageDeleted(account, folder, message);
}