From 46a467c00146ff2196405d0f7236be9867f405c3 Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 28 Sep 2018 14:01:33 +0000 Subject: [PATCH] Revert "Fixed threaded messages actions" This reverts commit 2b807d52533542cf1eca12086f19a0ba49593cbd. --- .../eu/faircode/email/AdapterMessage.java | 2 +- .../eu/faircode/email/FragmentMessages.java | 38 ++----------------- 2 files changed, 4 insertions(+), 36 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/AdapterMessage.java b/app/src/main/java/eu/faircode/email/AdapterMessage.java index 33c34715..fdf322c5 100644 --- a/app/src/main/java/eu/faircode/email/AdapterMessage.java +++ b/app/src/main/java/eu/faircode/email/AdapterMessage.java @@ -263,7 +263,7 @@ public class AdapterMessage extends PagedListAdapter() { @Override protected String[] onLoad(Context context, Bundle args) { long id = args.getLong("id"); int direction = args.getInt("direction"); - boolean single = args.getBoolean("single"); EntityFolder target = null; // Get target folder and hide message @@ -269,14 +266,7 @@ public class FragmentMessages extends FragmentEx { target = db.folder().getFolderByType(message.account, EntityFolder.TRASH); } - List messages = new ArrayList<>(); - if (single) - messages.add(message); - else - messages.addAll(db.message().getMessageByThread(message.account, message.thread)); - - for (EntityMessage m : messages) - db.message().setMessageUiHide(m.id, true); + db.message().setMessageUiHide(message.id, true); db.setTransactionSuccessful(); } finally { @@ -305,30 +295,8 @@ public class FragmentMessages extends FragmentEx { @Override protected Void onLoad(Context context, Bundle args) { long id = args.getLong("id"); - boolean single = args.getBoolean("single"); - - DB db = DB.getInstance(context); - try { - db.beginTransaction(); - - EntityMessage message = db.message().getMessage(id); - - List messages = new ArrayList<>(); - if (single) - messages.add(message); - else - messages.addAll(db.message().getMessageByThread(message.account, message.thread)); - - for (EntityMessage m : messages) { - Log.i(Helper.TAG, "Undo move id=" + m.id); - DB.getInstance(context).message().setMessageUiHide(m.id, false); - } - - db.setTransactionSuccessful(); - } finally { - db.endTransaction(); - } - + Log.i(Helper.TAG, "Undo move id=" + id); + DB.getInstance(context).message().setMessageUiHide(id, false); return null; }