Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 18ad0079 authored by Vincent Breitmoser's avatar Vincent Breitmoser
Browse files

Add setting to store all drafts encrypted

parent f9527b9e
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -216,6 +216,7 @@ public class Account implements BaseAccount, StoreConfig {
    private boolean autocryptPreferEncryptMutual;
    private boolean openPgpHideSignOnly;
    private boolean openPgpEncryptSubject;
    private boolean openPgpEncryptAllDrafts;
    private boolean markMessageAsReadOnView;
    private boolean alwaysShowCcBcc;
    private boolean allowRemoteSearch;
@@ -461,6 +462,7 @@ public class Account implements BaseAccount, StoreConfig {
        openPgpKey = storage.getLong(accountUuid + ".cryptoKey", NO_OPENPGP_KEY);
        openPgpHideSignOnly = storage.getBoolean(accountUuid + ".openPgpHideSignOnly", true);
        openPgpEncryptSubject = storage.getBoolean(accountUuid + ".openPgpEncryptSubject", true);
        openPgpEncryptAllDrafts = storage.getBoolean(accountUuid + ".openPgpEncryptAllDrafts", true);
        autocryptPreferEncryptMutual = storage.getBoolean(accountUuid + ".autocryptMutualMode", false);
        allowRemoteSearch = storage.getBoolean(accountUuid + ".allowRemoteSearch", false);
        remoteSearchFullText = storage.getBoolean(accountUuid + ".remoteSearchFullText", false);
@@ -740,6 +742,7 @@ public class Account implements BaseAccount, StoreConfig {
        editor.putLong(accountUuid + ".cryptoKey", openPgpKey);
        editor.putBoolean(accountUuid + ".openPgpHideSignOnly", openPgpHideSignOnly);
        editor.putBoolean(accountUuid + ".openPgpEncryptSubject", openPgpEncryptSubject);
        editor.putBoolean(accountUuid + ".openPgpEncryptAllDrafts", openPgpEncryptAllDrafts);
        editor.putString(accountUuid + ".openPgpProvider", openPgpProvider);
        editor.putBoolean(accountUuid + ".autocryptMutualMode", autocryptPreferEncryptMutual);
        editor.putBoolean(accountUuid + ".allowRemoteSearch", allowRemoteSearch);
@@ -1591,6 +1594,14 @@ public class Account implements BaseAccount, StoreConfig {
        this.openPgpEncryptSubject = openPgpEncryptSubject;
    }

    public boolean getOpenPgpEncryptAllDrafts() {
        return openPgpEncryptAllDrafts;
    }

    public void setOpenPgpEncryptAllDrafts(boolean openPgpEncryptAllDrafts) {
        this.openPgpEncryptAllDrafts = openPgpEncryptAllDrafts;
    }

    public boolean allowRemoteSearch() {
        return allowRemoteSearch;
    }
+3 −0
Original line number Diff line number Diff line
@@ -239,6 +239,9 @@ public class AccountSettings {
        s.put("openPgpEncryptSubject", Settings.versions(
                new V(51, new BooleanSetting(true))
        ));
        s.put("openPgpEncryptAllDrafts", Settings.versions(
                new V(55, new BooleanSetting(true))
        ));
        s.put("autocryptMutualMode", Settings.versions(
                new V(50, new BooleanSetting(false))
        ));
+1 −1
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@ public class Settings {
     *
     * @see SettingsExporter
     */
    public static final int VERSION = 54;
    public static final int VERSION = 55;

    static Map<String, Object> validate(int version, Map<String, TreeMap<Integer, SettingsDescription>> settings,
            Map<String, String> importedSettings, boolean useDefaultValues) {
+1 −0
Original line number Diff line number Diff line
@@ -55,6 +55,7 @@ class PgpMessageBuilderTest : RobolectricTest() {
            false,
            false,
            true,
            true,
            CryptoMode.NO_CHOICE
    )
    private val openPgpApi = mock(OpenPgpApi::class.java)
+2 −0
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ class AccountSettingsDataStore(
            "remote_search_enabled" -> account.allowRemoteSearch()
            "openpgp_hide_sign_only" -> account.openPgpHideSignOnly
            "openpgp_encrypt_subject" -> account.openPgpEncryptSubject
            "openpgp_encrypt_all_drafts" -> account.openPgpEncryptAllDrafts
            "autocrypt_prefer_encrypt" -> account.autocryptPreferEncryptMutual
            "upload_sent_messages" -> account.isUploadSentMessages
            else -> defValue
@@ -68,6 +69,7 @@ class AccountSettingsDataStore(
            "remote_search_enabled" -> account.setAllowRemoteSearch(value)
            "openpgp_hide_sign_only" -> account.openPgpHideSignOnly = value
            "openpgp_encrypt_subject" -> account.openPgpEncryptSubject = value
            "openpgp_encrypt_all_drafts" -> account.openPgpEncryptAllDrafts = value
            "autocrypt_prefer_encrypt" -> account.autocryptPreferEncryptMutual = value
            "upload_sent_messages" -> account.isUploadSentMessages = value
            else -> return
Loading