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

Attempt to fix Issue 192; making deleted messages stay deleted.

This commit is contained in:
Daniel Applebaum 2009-01-27 03:13:54 +00:00
parent 5517d3c2a4
commit 1bd3f31b95
2 changed files with 8 additions and 6 deletions

View File

@ -1910,6 +1910,7 @@ s * critical data as fast as possible, and then we'll fill in the de
try {
Store localStore = Store.getInstance(account.getLocalStoreUri(), mApplication);
Folder localFolder = localStore.getFolder(folder);
Message lMessage = localFolder.getMessage(message.getUid());
if (folder.equals(account.getTrashFolderName()))
{
@ -1917,7 +1918,7 @@ s * critical data as fast as possible, and then we'll fill in the de
{
Log.d(Email.LOG_TAG, "Deleting message in trash folder, not copying");
}
message.setFlag(Flag.DELETED, true);
lMessage.setFlag(Flag.DELETED, true);
}
else
{
@ -1936,16 +1937,17 @@ s * critical data as fast as possible, and then we'll fill in the de
fp.add(FetchProfile.Item.ENVELOPE);
fp.add(FetchProfile.Item.BODY);
// TODO: Turn the fetch/copy/delete into an atomic move
localFolder.fetch(new Message[] { message }, fp, null);
localFolder.copyMessages(new Message[] { message }, localTrashFolder);
localFolder.fetch(new Message[] { lMessage }, fp, null);
localFolder.copyMessages(new Message[] { lMessage }, localTrashFolder);
if (folder.equals(account.getOutboxFolderName())) {
message.setFlag(Flag.X_DESTROYED, true);
lMessage.setFlag(Flag.X_DESTROYED, true);
}
else {
message.setFlag(Flag.DELETED, true);
lMessage.setFlag(Flag.DELETED, true);
}
}
}
localFolder.close(false);
if (listener != null) {
listener.messageDeleted(account, folder, message);
}

View File

@ -1489,7 +1489,7 @@ public class FolderMessageList extends ExpandableListActivity
private void addOrUpdateMessage(FolderInfoHolder folder, Message message,
boolean sort, boolean notify)
{
if (folder.deletedUids.remove(message.getUid())){
if (folder.deletedUids.contains(message.getUid())){
return;
}
MessageInfoHolder m = getMessage(folder, message.getUid());