mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
use correct flag from core
This commit is contained in:
@@ -55,6 +55,7 @@ public class DcHelper {
|
||||
public static final String CONFIG_PRIVATE_TAG = "private_tag";
|
||||
public static final String CONFIG_STATS_SENDING = "stats_sending";
|
||||
public static final String CONFIG_STATS_ID = "stats_id";
|
||||
public static final String CONFIG_FORCE_ENCRYPTION = "force_encryption";
|
||||
|
||||
public static DcContext getContext(@NonNull Context context) {
|
||||
return ApplicationContext.getInstance(context).getDcContext();
|
||||
|
||||
@@ -115,7 +115,7 @@ public class EditRelayActivity extends BaseActionBarActivity
|
||||
SwitchCompat enforceE2eeSwitch = findViewById(R.id.enforce_e2ee_switch);
|
||||
enforceE2eeSwitch.setOnCheckedChangeListener(
|
||||
(b, isChecked) -> {
|
||||
// TODO: use new core API to set the config
|
||||
getContext(this).setConfigInt(DcHelper.CONFIG_FORCE_ENCRYPTION, isChecked ? 1 : 0);
|
||||
});
|
||||
|
||||
String addr = getIntent().getStringExtra(EXTRA_ADDR);
|
||||
@@ -180,9 +180,9 @@ public class EditRelayActivity extends BaseActionBarActivity
|
||||
boolean expandAdvanced = false;
|
||||
int intVal;
|
||||
|
||||
intVal = 0; // TODO: get the current "enforce_e2ee" value
|
||||
intVal = getContext(this).getConfigInt(DcHelper.CONFIG_FORCE_ENCRYPTION);
|
||||
enforceE2eeSwitch.setChecked(intVal == 1);
|
||||
expandAdvanced = expandAdvanced || intVal == 1;
|
||||
expandAdvanced = expandAdvanced || intVal == 0;
|
||||
|
||||
if (config != null) { // configured
|
||||
emailInput.setText(config.addr);
|
||||
|
||||
Reference in New Issue
Block a user