use correct flag from core

This commit is contained in:
B. Petersen
2026-05-22 17:28:17 +02:00
parent cef6817187
commit 74f6853815
2 changed files with 4 additions and 3 deletions
@@ -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);