Refactoring

pull/194/head
M66B 4 years ago
parent f8264e6754
commit cbfed68c6b

@ -301,9 +301,10 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
state.index = i + 1; state.index = i + 1;
TupleMatch match = state.matches.get(i); TupleMatch match = state.matches.get(i);
if (criteria.query != null && boolean matched = (match.matched != null && match.matched);
criteria.in_message &&
(match.matched == null || !match.matched)) if (criteria.query != null) {
if (!matched && criteria.in_message)
try { try {
File file = EntityMessage.getFile(context, match.id); File file = EntityMessage.getFile(context, match.id);
if (file.exists()) { if (file.exists()) {
@ -311,14 +312,15 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
if (html.toLowerCase().contains(criteria.query)) { if (html.toLowerCase().contains(criteria.query)) {
String text = HtmlHelper.getFullText(html); String text = HtmlHelper.getFullText(html);
if (text.toLowerCase().contains(criteria.query)) if (text.toLowerCase().contains(criteria.query))
match.matched = true; matched = true;
} }
} }
} catch (IOException ex) { } catch (IOException ex) {
Log.e(ex); Log.e(ex);
} }
}
if (match.matched != null && match.matched) { if (matched) {
found++; found++;
Log.i("Boundary matched=" + match.id); Log.i("Boundary matched=" + match.id);
db.message().setMessageFound(match.id); db.message().setMessageFound(match.id);

Loading…
Cancel
Save