mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-27 11:25:13 +01:00
Added search in html (debug version only)
This commit is contained in:
@@ -305,15 +305,19 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
|
||||
boolean matched = (match.matched != null && match.matched);
|
||||
|
||||
if (query != null) {
|
||||
if (!matched && criteria.in_message)
|
||||
if (!matched && (criteria.in_message || criteria.in_html))
|
||||
try {
|
||||
File file = EntityMessage.getFile(context, match.id);
|
||||
if (file.exists()) {
|
||||
String html = Helper.readText(file);
|
||||
if (html.toLowerCase().contains(query)) {
|
||||
String text = HtmlHelper.getFullText(html);
|
||||
if (text != null && text.toLowerCase().contains(query))
|
||||
if (criteria.in_html)
|
||||
matched = true;
|
||||
else {
|
||||
String text = HtmlHelper.getFullText(html);
|
||||
if (text != null && text.toLowerCase().contains(query))
|
||||
matched = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (IOException ex) {
|
||||
@@ -677,6 +681,7 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
|
||||
boolean in_message = true;
|
||||
boolean in_notes = true;
|
||||
boolean in_headers = false;
|
||||
boolean in_html = false;
|
||||
boolean with_unseen;
|
||||
boolean with_flagged;
|
||||
boolean with_hidden;
|
||||
@@ -871,6 +876,7 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
|
||||
this.in_message == other.in_message &&
|
||||
this.in_notes == other.in_notes &&
|
||||
this.in_headers == other.in_headers &&
|
||||
this.in_html == other.in_html &&
|
||||
this.with_unseen == other.with_unseen &&
|
||||
this.with_flagged == other.with_flagged &&
|
||||
this.with_hidden == other.with_hidden &&
|
||||
@@ -897,6 +903,7 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
|
||||
" message=" + in_message +
|
||||
" notes=" + in_notes +
|
||||
" headers=" + in_headers +
|
||||
" html=" + in_html +
|
||||
" unseen=" + with_unseen +
|
||||
" flagged=" + with_flagged +
|
||||
" hidden=" + with_hidden +
|
||||
|
||||
Reference in New Issue
Block a user