mirror of https://github.com/M66B/FairEmail.git
Set account/identity to insecure when updating and untrusted
This commit is contained in:
parent
123d61e21f
commit
74eff71cae
|
@ -229,10 +229,10 @@ public interface DaoAccount {
|
|||
int setAccountPassword(long id, String password, int auth_type, String provider);
|
||||
|
||||
@Query("UPDATE account" +
|
||||
" SET fingerprint = :fingerprint" +
|
||||
" SET fingerprint = :fingerprint, insecure = :insecure" +
|
||||
" WHERE id = :id" +
|
||||
" AND NOT (fingerprint IS :fingerprint)")
|
||||
int setAccountFingerprint(long id, String fingerprint);
|
||||
int setAccountFingerprint(long id, String fingerprint, boolean insecure);
|
||||
|
||||
@Query("UPDATE account SET last_connected = :last_connected WHERE id = :id AND NOT (last_connected IS :last_connected)")
|
||||
int setAccountConnected(long id, Long last_connected);
|
||||
|
|
|
@ -137,10 +137,10 @@ public interface DaoIdentity {
|
|||
int setIdentityPassword(long account, String user, String password, Integer auth_type, int new_auth_type, String provider);
|
||||
|
||||
@Query("UPDATE identity" +
|
||||
" SET fingerprint = :fingerprint" +
|
||||
" SET fingerprint = :fingerprint, insecure = :insecure" +
|
||||
" WHERE account = :account" +
|
||||
" AND NOT (fingerprint IS :fingerprint)")
|
||||
int setIdentityFingerprint(long account, String fingerprint);
|
||||
int setIdentityFingerprint(long account, String fingerprint, boolean insecure);
|
||||
|
||||
@Query("UPDATE identity SET last_connected = :last_connected WHERE id = :id AND NOT (last_connected IS :last_connected)")
|
||||
int setIdentityConnected(long id, long last_connected);
|
||||
|
|
|
@ -632,6 +632,7 @@ public class FragmentQuickSetup extends FragmentBase {
|
|||
identity.user = user;
|
||||
identity.password = password;
|
||||
identity.fingerprint = smtp_fingerprint;
|
||||
|
||||
identity.use_ip = provider.useip;
|
||||
identity.synchronize = true;
|
||||
identity.primary = true;
|
||||
|
@ -642,11 +643,15 @@ public class FragmentQuickSetup extends FragmentBase {
|
|||
} else {
|
||||
args.putLong("account", update.id);
|
||||
EntityLog.log(context, "Quick setup update account=" + update.name);
|
||||
|
||||
db.account().setAccountSynchronize(update.id, true);
|
||||
db.account().setAccountPassword(update.id, password, AUTH_TYPE_PASSWORD, null);
|
||||
db.account().setAccountFingerprint(update.id, imap_fingerprint);
|
||||
db.account().setAccountFingerprint(update.id, imap_fingerprint,
|
||||
BuildConfig.PLAY_STORE_RELEASE && !TextUtils.isEmpty(imap_fingerprint));
|
||||
|
||||
db.identity().setIdentityPassword(update.id, update.user, password, update.auth_type, AUTH_TYPE_PASSWORD, null);
|
||||
db.identity().setIdentityFingerprint(update.id, smtp_fingerprint);
|
||||
db.identity().setIdentityFingerprint(update.id, smtp_fingerprint,
|
||||
BuildConfig.PLAY_STORE_RELEASE && !TextUtils.isEmpty(smtp_fingerprint));
|
||||
}
|
||||
|
||||
db.setTransactionSuccessful();
|
||||
|
|
Loading…
Reference in New Issue