1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-25 09:17:58 +00:00

Check swipe target

This commit is contained in:
M66B 2018-10-21 14:23:48 +00:00
parent 94ede60603
commit 3980cd6dd3

View file

@ -338,7 +338,10 @@ public class FragmentMessages extends FragmentEx {
EntityMessage message = db.message().getMessage(id);
EntityFolder folder = db.folder().getFolder(message.folder);
if (swipeTarget < 0 || direction == ItemTouchHelper.LEFT) {
if (swipeTarget >= 0 && direction == ItemTouchHelper.RIGHT)
target = db.folder().getFolder(swipeTarget);
if (target == null || !target.account.equals((message.account))) {
if (EntityFolder.ARCHIVE.equals(folder.type) || EntityFolder.TRASH.equals(folder.type))
target = db.folder().getFolderByType(message.account, EntityFolder.INBOX);
else {
@ -349,8 +352,6 @@ public class FragmentMessages extends FragmentEx {
if (target == null)
target = db.folder().getFolderByType(message.account, EntityFolder.INBOX);
}
} else {
target = db.folder().getFolder(swipeTarget);
}
result.target = target.name;