mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-28 02:37:16 +00:00
Refactoring
This commit is contained in:
parent
f8264e6754
commit
cbfed68c6b
1 changed files with 19 additions and 17 deletions
|
@ -301,24 +301,26 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
|
|||
state.index = i + 1;
|
||||
|
||||
TupleMatch match = state.matches.get(i);
|
||||
if (criteria.query != null &&
|
||||
criteria.in_message &&
|
||||
(match.matched == null || !match.matched))
|
||||
try {
|
||||
File file = EntityMessage.getFile(context, match.id);
|
||||
if (file.exists()) {
|
||||
String html = Helper.readText(file);
|
||||
if (html.toLowerCase().contains(criteria.query)) {
|
||||
String text = HtmlHelper.getFullText(html);
|
||||
if (text.toLowerCase().contains(criteria.query))
|
||||
match.matched = true;
|
||||
}
|
||||
}
|
||||
} catch (IOException ex) {
|
||||
Log.e(ex);
|
||||
}
|
||||
boolean matched = (match.matched != null && match.matched);
|
||||
|
||||
if (match.matched != null && match.matched) {
|
||||
if (criteria.query != null) {
|
||||
if (!matched && criteria.in_message)
|
||||
try {
|
||||
File file = EntityMessage.getFile(context, match.id);
|
||||
if (file.exists()) {
|
||||
String html = Helper.readText(file);
|
||||
if (html.toLowerCase().contains(criteria.query)) {
|
||||
String text = HtmlHelper.getFullText(html);
|
||||
if (text.toLowerCase().contains(criteria.query))
|
||||
matched = true;
|
||||
}
|
||||
}
|
||||
} catch (IOException ex) {
|
||||
Log.e(ex);
|
||||
}
|
||||
}
|
||||
|
||||
if (matched) {
|
||||
found++;
|
||||
Log.i("Boundary matched=" + match.id);
|
||||
db.message().setMessageFound(match.id);
|
||||
|
|
Loading…
Reference in a new issue