UIDL capability cannot change

pull/210/head
M66B 2 years ago
parent f3f88f7b4e
commit af1824aa41

File diff suppressed because it is too large Load Diff

@ -3058,7 +3058,19 @@ class Core {
// Get capabilities
Map<String, String> caps = istore.capabilities();
boolean hasUidl = caps.containsKey("UIDL");
EntityLog.log(context, account.name + " POP capabilities= " + caps.keySet());
EntityLog.log(context, account.name +
" POP capabilities= " + caps.keySet() +
" uidl=" + account.capability_uidl);
if (hasUidl) {
if (Boolean.FALSE.equals(account.capability_uidl)) {
hasUidl = false;
Log.w(account.host + " did not had UIDL before");
}
} else {
account.capability_uidl = false;
db.account().setAccountUidl(account.id, account.capability_uidl);
}
// Get messages
Message[] imessages = ifolder.getMessages();

@ -68,7 +68,7 @@ import javax.mail.internet.InternetAddress;
// https://developer.android.com/topic/libraries/architecture/room.html
@Database(
version = 255,
version = 256,
entities = {
EntityIdentity.class,
EntityAccount.class,
@ -2589,6 +2589,12 @@ public abstract class DB extends RoomDatabase {
logMigration(startVersion, endVersion);
db.execSQL("ALTER TABLE `message` ADD COLUMN `ui_local_only` INTEGER NOT NULL DEFAULT 0");
}
}).addMigrations(new Migration(255, 256) {
@Override
public void migrate(@NonNull SupportSQLiteDatabase db) {
logMigration(startVersion, endVersion);
db.execSQL("ALTER TABLE `account` ADD COLUMN `capability_uidl` INTEGER");
}
}).addMigrations(new Migration(998, 999) {
@Override
public void migrate(@NonNull SupportSQLiteDatabase db) {

@ -297,6 +297,9 @@ public interface DaoAccount {
@Query("UPDATE account SET tbd = 1 WHERE id = :id AND NOT (tbd IS 1)")
int setAccountTbd(long id);
@Query("UPDATE account SET capability_uidl = :uidl WHERE id = :id AND NOT (capability_uidl IS :uidl)")
int setAccountUidl(long id, Boolean uidl);
@Query("DELETE FROM account WHERE id = :id")
int deleteAccount(long id);
}

@ -167,6 +167,7 @@ public class EntityAccount extends EntityOrder implements Serializable {
public String capabilities;
public Boolean capability_idle;
public Boolean capability_utf8;
public Boolean capability_uidl;
boolean isGmail() {
return "imap.gmail.com".equalsIgnoreCase(host) ||

Loading…
Cancel
Save