mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-04 06:20:26 +00:00
Fixed local search
This commit is contained in:
parent
416712cb1c
commit
de21a65935
1 changed files with 4 additions and 1 deletions
|
@ -101,6 +101,7 @@ public class ViewModelBrowse extends ViewModel {
|
||||||
boolean match = false;
|
boolean match = false;
|
||||||
String find = search.toLowerCase();
|
String find = search.toLowerCase();
|
||||||
EntityMessage message = db.message().getMessage(messages.get(i));
|
EntityMessage message = db.message().getMessage(messages.get(i));
|
||||||
|
String body = (message.content ? message.read(context) : null);
|
||||||
|
|
||||||
if (message.from != null)
|
if (message.from != null)
|
||||||
for (int j = 0; j < message.from.length && !match; j++)
|
for (int j = 0; j < message.from.length && !match; j++)
|
||||||
|
@ -114,13 +115,15 @@ public class ViewModelBrowse extends ViewModel {
|
||||||
match = message.subject.toLowerCase().contains(find);
|
match = message.subject.toLowerCase().contains(find);
|
||||||
|
|
||||||
if (!match && message.content)
|
if (!match && message.content)
|
||||||
match = message.read(context).toLowerCase().contains(find);
|
match = body.toLowerCase().contains(find);
|
||||||
|
|
||||||
if (match) {
|
if (match) {
|
||||||
matched++;
|
matched++;
|
||||||
message.id = null;
|
message.id = null;
|
||||||
message.ui_found = true;
|
message.ui_found = true;
|
||||||
message.id = db.message().insertMessage(message);
|
message.id = db.message().insertMessage(message);
|
||||||
|
if (message.content)
|
||||||
|
message.write(context, body);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue