|
|
|
@ -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;
|
|
|
|
|
boolean matched = (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);
|
|
|
|
|
}
|
|
|
|
|
} catch (IOException ex) {
|
|
|
|
|
Log.e(ex);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (match.matched != null && match.matched) {
|
|
|
|
|
if (matched) {
|
|
|
|
|
found++;
|
|
|
|
|
Log.i("Boundary matched=" + match.id);
|
|
|
|
|
db.message().setMessageFound(match.id);
|
|
|
|
|