From 064ee0ba484113609ddcaa5af76a5734c72ba636 Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 26 Feb 2021 14:44:19 +0100 Subject: [PATCH] Use FTS if enabled for external search, cleanup --- .../java/eu/faircode/email/ActivityView.java | 10 +++++++++- .../email/BoundaryCallbackMessages.java | 18 ------------------ 2 files changed, 9 insertions(+), 19 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/ActivityView.java b/app/src/main/java/eu/faircode/email/ActivityView.java index 0d0382cddb..d691a12c64 100644 --- a/app/src/main/java/eu/faircode/email/ActivityView.java +++ b/app/src/main/java/eu/faircode/email/ActivityView.java @@ -1094,9 +1094,17 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB String search = (csearch == null ? null : csearch.toString()); if (!TextUtils.isEmpty(search)) { searching = true; + + SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); + boolean fts = prefs.getBoolean("fts", false); + + BoundaryCallbackMessages.SearchCriteria criteria = new BoundaryCallbackMessages.SearchCriteria(); + criteria.query = search; + criteria.fts = fts; + FragmentMessages.search( ActivityView.this, ActivityView.this, getSupportFragmentManager(), - -1, -1, false, new BoundaryCallbackMessages.SearchCriteria(search)); + -1, -1, false, criteria); } intent.removeExtra(Intent.EXTRA_PROCESS_TEXT); diff --git a/app/src/main/java/eu/faircode/email/BoundaryCallbackMessages.java b/app/src/main/java/eu/faircode/email/BoundaryCallbackMessages.java index 98f8f6d996..4dc419623d 100644 --- a/app/src/main/java/eu/faircode/email/BoundaryCallbackMessages.java +++ b/app/src/main/java/eu/faircode/email/BoundaryCallbackMessages.java @@ -657,24 +657,6 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback 1 && "+-?".indexOf(w.charAt(0)) >= 0) - return true; - - return false; - } - SearchTerm getTerms(boolean utf8, Flags flags, String[] keywords) { List or = new ArrayList<>(); List and = new ArrayList<>();