Added search in html (debug version only)

This commit is contained in:
M66B
2021-04-27 09:12:10 +02:00
parent e6d4aa8cd4
commit 865500ff1e
5 changed files with 33 additions and 5 deletions

View File

@@ -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 +