From 6a433c4252d16e797d513dc822cf7782ec513bdd Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 12 Apr 2021 11:08:26 +0200 Subject: [PATCH] Revert "Revert "Revert "Link to message thread""" This reverts commit ee8dc05b226efcbb4b727cf4c04bfe17aa778913. --- .../main/java/eu/faircode/email/ActivityMain.java | 12 +++--------- .../main/java/eu/faircode/email/AdapterMessage.java | 4 +++- .../main/java/eu/faircode/email/EntityMessage.java | 5 ----- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/ActivityMain.java b/app/src/main/java/eu/faircode/email/ActivityMain.java index 7fc71b6dcc..8882e7941b 100644 --- a/app/src/main/java/eu/faircode/email/ActivityMain.java +++ b/app/src/main/java/eu/faircode/email/ActivityMain.java @@ -66,18 +66,12 @@ public class ActivityMain extends ActivityBase implements FragmentManager.OnBack if (path == null) return null; String[] parts = path.split("/"); - if (parts.length < 3) + if (parts.length < 1) return null; - - long account = Long.parseLong(parts[1]); - String msgid = parts[2]; + long id = Long.parseLong(parts[1]); DB db = DB.getInstance(context); - List messages = db.message().getMessagesByMsgId(account, msgid); - if (messages == null || messages.size() == 0) - return null; - - return messages.get(0); + return db.message().getMessage(id); } @Override diff --git a/app/src/main/java/eu/faircode/email/AdapterMessage.java b/app/src/main/java/eu/faircode/email/AdapterMessage.java index 2aec4fd688..5a21d4fc50 100644 --- a/app/src/main/java/eu/faircode/email/AdapterMessage.java +++ b/app/src/main/java/eu/faircode/email/AdapterMessage.java @@ -4825,11 +4825,13 @@ public class AdapterMessage extends RecyclerView.Adapter'; } - String getLink() { - return "message://" + BuildConfig.APPLICATION_ID + "/" + this.account + "/" + Uri.encode(this.msgid); - } - boolean replySelf(List identities, long account) { Address[] senders = (reply == null || reply.length == 0 ? from : reply); if (identities != null && senders != null)