mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-24 15:11:03 +00:00
Revert "Reset FTS on disabling account"
This reverts commit 0403c81bd5
.
This commit is contained in:
parent
435aa733d6
commit
1f454909d3
10 changed files with 10 additions and 26 deletions
|
@ -514,8 +514,6 @@ public class AdapterAccount extends RecyclerView.Adapter<AdapterAccount.ViewHold
|
|||
}
|
||||
|
||||
db.account().setAccountSynchronize(id, sync);
|
||||
if (!sync)
|
||||
db.message().resetFts(id);
|
||||
|
||||
db.setTransactionSuccessful();
|
||||
} finally {
|
||||
|
|
|
@ -478,8 +478,6 @@ public class CloudSync {
|
|||
}
|
||||
raccount.move_to = laccount.move_to; // TODO
|
||||
db.account().updateAccount(raccount);
|
||||
if (!raccount.synchronize)
|
||||
db.message().resetFts(raccount.id);
|
||||
}
|
||||
|
||||
if (raccount.id != null) {
|
||||
|
|
|
@ -946,10 +946,8 @@ public interface DaoMessage {
|
|||
" AND account IN (SELECT id FROM account WHERE pop = " + EntityAccount.TYPE_IMAP + ")")
|
||||
int clearRawMessages();
|
||||
|
||||
@Query("UPDATE message SET fts = 0" +
|
||||
" WHERE NOT (fts IS 0)" +
|
||||
" AND (:account IS NULL OR message.account = :account)")
|
||||
int resetFts(Long account);
|
||||
@Query("UPDATE message SET fts = 0 WHERE NOT (fts IS 0)")
|
||||
int resetFts();
|
||||
|
||||
@Query("DELETE FROM message WHERE id = :id")
|
||||
int deleteMessage(long id);
|
||||
|
|
|
@ -1329,11 +1329,9 @@ public class FragmentAccount extends FragmentBase {
|
|||
if (account.primary)
|
||||
db.account().resetPrimary();
|
||||
|
||||
if (update) {
|
||||
if (update)
|
||||
db.account().updateAccount(account);
|
||||
if (!account.synchronize)
|
||||
db.message().resetFts(account.id);
|
||||
} else
|
||||
else
|
||||
account.id = db.account().insertAccount(account);
|
||||
|
||||
args.putLong("account", account.id);
|
||||
|
@ -1455,8 +1453,6 @@ public class FragmentAccount extends FragmentBase {
|
|||
account.swipe_right = (right == null ? null : right.id);
|
||||
account.move_to = (move == null ? null : move.id);
|
||||
db.account().updateAccount(account);
|
||||
if (!account.synchronize)
|
||||
db.message().resetFts(account.id);
|
||||
|
||||
db.setTransactionSuccessful();
|
||||
} finally {
|
||||
|
|
|
@ -571,8 +571,6 @@ public class FragmentGmail extends FragmentBase {
|
|||
FragmentDialogSwipes.setDefaultFolderActions(context, account);
|
||||
|
||||
db.account().updateAccount(account);
|
||||
if (!account.synchronize)
|
||||
db.message().resetFts(account.id);
|
||||
|
||||
if (TextUtils.isEmpty(name))
|
||||
name = user.split("@")[0];
|
||||
|
|
|
@ -995,8 +995,6 @@ public class FragmentOAuth extends FragmentBase {
|
|||
FragmentDialogSwipes.setDefaultFolderActions(context, account);
|
||||
|
||||
db.account().updateAccount(account);
|
||||
if (!account.synchronize)
|
||||
db.message().resetFts(account.id);
|
||||
|
||||
// Create identities
|
||||
if (!inbound_only)
|
||||
|
|
|
@ -588,7 +588,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
|||
}
|
||||
|
||||
DB db = DB.getInstance(context);
|
||||
db.message().resetFts(null);
|
||||
db.message().resetFts();
|
||||
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -670,11 +670,9 @@ public class FragmentPop extends FragmentBase {
|
|||
if (account.primary)
|
||||
db.account().resetPrimary();
|
||||
|
||||
if (update) {
|
||||
if (update)
|
||||
db.account().updateAccount(account);
|
||||
if (!account.synchronize)
|
||||
db.message().resetFts(account.id);
|
||||
} else
|
||||
else
|
||||
account.id = db.account().insertAccount(account);
|
||||
|
||||
args.putLong("account", account.id);
|
||||
|
|
|
@ -57,7 +57,7 @@ public class Fts4DbHelper extends SQLiteOpenHelper {
|
|||
boolean has = context.getDatabasePath(DATABASE_NAME).exists();
|
||||
if (instance == null || !has) {
|
||||
if (!has)
|
||||
DB.getInstance(context).message().resetFts(null);
|
||||
DB.getInstance(context).message().resetFts();
|
||||
instance = new Fts4DbHelper(context);
|
||||
}
|
||||
return instance.getWritableDatabase();
|
||||
|
@ -96,7 +96,7 @@ public class Fts4DbHelper extends SQLiteOpenHelper {
|
|||
|
||||
onCreate(db);
|
||||
|
||||
DB.getInstance(context).message().resetFts(null);
|
||||
DB.getInstance(context).message().resetFts();
|
||||
}
|
||||
|
||||
static void insert(SQLiteDatabase db, EntityMessage message, List<EntityAttachment> attachments, String text) {
|
||||
|
|
|
@ -85,7 +85,7 @@ public class Fts5DbHelper extends SQLiteOpenHelper {
|
|||
|
||||
onCreate(db);
|
||||
|
||||
DB.getInstance(context).message().resetFts(null);
|
||||
DB.getInstance(context).message().resetFts();
|
||||
}
|
||||
|
||||
static void insert(SQLiteDatabase db, EntityMessage message, String text) {
|
||||
|
|
Loading…
Reference in a new issue