mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-24 23:12:55 +00:00
Refactoring
This commit is contained in:
parent
ccb026b7b2
commit
52b43e0d73
2 changed files with 39 additions and 41 deletions
|
@ -310,13 +310,14 @@ public interface DaoMessage {
|
|||
" ORDER BY message.received DESC")
|
||||
List<Long> getMessageIdsByFolder(Long folder);
|
||||
|
||||
@Transaction
|
||||
@Query("SELECT message.id FROM message" +
|
||||
" JOIN folder_view AS folder ON folder.id = message.folder" +
|
||||
" WHERE content" +
|
||||
" AND NOT fts" +
|
||||
" AND folder.type <> '" + EntityFolder.OUTBOX + "'" +
|
||||
" ORDER BY message.received")
|
||||
Cursor getMessageFts();
|
||||
List<Long> getMessageFts();
|
||||
|
||||
@Query("SELECT message.id, account, thread, (:find IS NULL" +
|
||||
" OR (:senders AND `from` LIKE :find COLLATE NOCASE)" + // no index
|
||||
|
|
|
@ -21,7 +21,6 @@ package eu.faircode.email;
|
|||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.database.Cursor;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
@ -66,10 +65,9 @@ public class WorkerFts extends Worker {
|
|||
|
||||
SQLiteDatabase sdb = FtsDbHelper.getInstance(context);
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
try (Cursor cursor = db.message().getMessageFts()) {
|
||||
while (cursor.moveToNext())
|
||||
|
||||
for (long id : db.message().getMessageFts())
|
||||
try {
|
||||
long id = cursor.getLong(0);
|
||||
Log.i("FTS index=" + id);
|
||||
|
||||
ids.add(id);
|
||||
|
@ -108,7 +106,6 @@ public class WorkerFts extends Worker {
|
|||
}
|
||||
|
||||
markIndexed(db, ids);
|
||||
}
|
||||
|
||||
Log.i("FTS indexed=" + indexed);
|
||||
return Result.success();
|
||||
|
|
Loading…
Reference in a new issue