mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-01 12:44:42 +00:00
Leave copy in archive if moving from archive
Except when moving to junk/trash
This commit is contained in:
parent
275ac6735c
commit
8defea14b8
1 changed files with 20 additions and 13 deletions
|
@ -1547,24 +1547,31 @@ public class ServiceSynchronize extends LifecycleService {
|
|||
if (imessage == null)
|
||||
throw new MessageRemovedException();
|
||||
|
||||
if (istore.hasCapability("MOVE")) {
|
||||
Folder itarget = istore.getFolder(target.name);
|
||||
ifolder.moveMessages(new Message[]{imessage}, itarget);
|
||||
} else {
|
||||
Log.w(Helper.TAG, "MOVE by DELETE/APPEND");
|
||||
|
||||
if (!EntityFolder.ARCHIVE.equals(folder.type)) {
|
||||
imessage.setFlag(Flags.Flag.DELETED, true);
|
||||
ifolder.expunge();
|
||||
}
|
||||
|
||||
if (EntityFolder.ARCHIVE.equals(folder.type) &&
|
||||
!(EntityFolder.JUNK.equals(target.type) || EntityFolder.TRASH.equals(target.type))) {
|
||||
MimeMessageEx icopy = MessageHelper.from(this, message, isession);
|
||||
Folder itarget = istore.getFolder(target.name);
|
||||
itarget.appendMessages(new Message[]{icopy});
|
||||
}
|
||||
|
||||
if (EntityFolder.ARCHIVE.equals(folder.type))
|
||||
db.message().setMessageUiHide(message.id, false);
|
||||
|
||||
} else {
|
||||
if (istore.hasCapability("MOVE")) {
|
||||
Folder itarget = istore.getFolder(target.name);
|
||||
ifolder.moveMessages(new Message[]{imessage}, itarget);
|
||||
} else {
|
||||
Log.w(Helper.TAG, "MOVE by DELETE/APPEND");
|
||||
|
||||
if (!EntityFolder.ARCHIVE.equals(folder.type)) {
|
||||
imessage.setFlag(Flags.Flag.DELETED, true);
|
||||
ifolder.expunge();
|
||||
}
|
||||
|
||||
MimeMessageEx icopy = MessageHelper.from(this, message, isession);
|
||||
Folder itarget = istore.getFolder(target.name);
|
||||
itarget.appendMessages(new Message[]{icopy});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void doDelete(EntityFolder folder, IMAPFolder ifolder, EntityMessage message, JSONArray jargs, DB db) throws MessagingException, JSONException {
|
||||
|
|
Loading…
Reference in a new issue