mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-30 13:12:25 -05:00
Attempt to fix Issue 192; making deleted messages stay deleted.
This commit is contained in:
parent
5517d3c2a4
commit
1bd3f31b95
@ -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);
|
||||
}
|
||||
|
@ -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());
|
||||
|
Loading…
Reference in New Issue
Block a user