From 1e7707d6777a319a3958865d4be70c439bdfbcbe Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 8 Jan 2022 10:31:44 +0100 Subject: [PATCH] Cache thread ID --- app/src/main/java/eu/faircode/email/MessageHelper.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/src/main/java/eu/faircode/email/MessageHelper.java b/app/src/main/java/eu/faircode/email/MessageHelper.java index 4c7dee5548..e9eeb2a671 100644 --- a/app/src/main/java/eu/faircode/email/MessageHelper.java +++ b/app/src/main/java/eu/faircode/email/MessageHelper.java @@ -125,6 +125,7 @@ public class MessageHelper { private boolean ensuredStructure = false; private MimeMessage imessage; private String hash = null; + private String threadId = null; private InternetHeaders reportHeaders = null; private static File cacheDir = null; @@ -1285,6 +1286,12 @@ public class MessageHelper { } String getThreadId(Context context, long account, long folder, long uid) throws MessagingException { + if (threadId == null) + threadId = _getThreadId(context, account, folder, uid); + return threadId; + } + + private String _getThreadId(Context context, long account, long folder, long uid) throws MessagingException { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); if (imessage instanceof GmailMessage) {