Commit 5a8888d2 authored by Grigory Fedorov's avatar Grigory Fedorov

Some account preferences default values set in preferences.xml

parent aed3ee23
...@@ -398,17 +398,20 @@ public class AccountManager implements OnLoadListener, OnWipeListener { ...@@ -398,17 +398,20 @@ public class AccountManager implements OnLoadListener, OnWipeListener {
} }
boolean useCustomHost = false; boolean useCustomHost = application.getResources().getBoolean(R.bool.account_use_custom_host_default);
if (accountType.getProtocol() == AccountProtocol.gtalk) { if (accountType.getProtocol() == AccountProtocol.gtalk) {
useCustomHost = true; useCustomHost = true;
} }
boolean useCompression = application.getResources().getBoolean(R.bool.account_use_compression_default);
ArchiveMode archiveMode = ArchiveMode.valueOf(application.getString(R.string.account_archive_mode_default_value));
accountItem = addAccount(accountType.getProtocol(), useCustomHost, host, port, serverName, userName, accountItem = addAccount(accountType.getProtocol(), useCustomHost, host, port, serverName, userName,
storePassword, password, resource, getNextColorIndex(), 0, StatusMode.available, storePassword, password, resource, getNextColorIndex(), 0, StatusMode.available,
SettingsManager.statusText(), true, true, tlsRequired ? TLSMode.required : TLSMode.enabled, SettingsManager.statusText(), true, true, tlsRequired ? TLSMode.required : TLSMode.enabled,
false, useOrbot ? ProxyType.orbot : ProxyType.none, "localhost", 8080, useCompression, useOrbot ? ProxyType.orbot : ProxyType.none, "localhost", 8080,
"", "", syncable, null, null, ArchiveMode.available, registerNewAccount); "", "", syncable, null, null, archiveMode, registerNewAccount);
if (accountItem == null) { if (accountItem == null) {
throw new NetworkException(R.string.ACCOUNT_REGISTER_FAILED); throw new NetworkException(R.string.ACCOUNT_REGISTER_FAILED);
} }
......
...@@ -373,6 +373,7 @@ ...@@ -373,6 +373,7 @@
<string name="account_username_key">account_username</string> <string name="account_username_key">account_username</string>
<string name="account_store_password_key">account_store_password</string> <string name="account_store_password_key">account_store_password</string>
<string name="account_password_key">account_password</string> <string name="account_password_key">account_password</string>
<bool name="account_use_custom_host_default">true</bool>
<string name="account_host_key">account_host</string> <string name="account_host_key">account_host</string>
<string name="account_port_key">account_port</string> <string name="account_port_key">account_port</string>
<string name="account_server_key">account_server</string> <string name="account_server_key">account_server</string>
...@@ -381,6 +382,7 @@ ...@@ -381,6 +382,7 @@
<string name="account_sasl_key">account_sasl</string> <string name="account_sasl_key">account_sasl</string>
<string name="account_tls_mode_key">account_tls_mode</string> <string name="account_tls_mode_key">account_tls_mode</string>
<string name="account_compression_key">account_compression</string> <string name="account_compression_key">account_compression</string>
<bool name="account_use_compression_default">true</bool>
<string name="account_proxy_type_key">account_proxy_type</string> <string name="account_proxy_type_key">account_proxy_type</string>
<string name="account_proxy_host_key">account_proxy_host</string> <string name="account_proxy_host_key">account_proxy_host</string>
<string name="account_proxy_port_key">account_proxy_port</string> <string name="account_proxy_port_key">account_proxy_port</string>
...@@ -431,6 +433,8 @@ ...@@ -431,6 +433,8 @@
<item>@string/account_archive_mode_dont_store</item> <item>@string/account_archive_mode_dont_store</item>
</string-array> </string-array>
<string name="account_archive_mode_default_value">local</string>
<!-- preference_security --> <!-- preference_security -->
<string name="security_check_certificate_key">security_check_certificate</string> <string name="security_check_certificate_key">security_check_certificate</string>
<bool name="security_check_certificate_default">false</bool> <bool name="security_check_certificate_default">false</bool>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment