From ccbeed18bfc471f74a9cd29def84daa03b0bb992 Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 25 Oct 2018 06:28:27 +0000 Subject: [PATCH] Move all messages in thread of selected message --- .../main/java/eu/faircode/email/FragmentMessages.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index 2f462ded..ac6c7d81 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -624,10 +624,15 @@ public class FragmentMessages extends FragmentEx { db.beginTransaction(); for (long id : ids) { - db.message().setMessageUiHide(id, true); - EntityMessage message = db.message().getMessage(id); - EntityOperation.queue(db, message, EntityOperation.MOVE, target); + List messages = + db.message().getMessageByThread(message.account, message.thread); + for (EntityMessage threaded : messages) { + if (threaded.folder.equals(message.folder)) { + db.message().setMessageUiHide(threaded.id, true); + EntityOperation.queue(db, threaded, EntityOperation.MOVE, target); + } + } } db.setTransactionSuccessful();