unify multi-device into a single setting

This commit is contained in:
adbenitez
2025-11-12 17:47:52 +01:00
parent 85f679c69f
commit 42d0a40f58
5 changed files with 15 additions and 14 deletions
@@ -110,6 +110,11 @@ public class ApplicationContext extends MultiDexApplication {
e.printStackTrace();
}
}
// 12.11.25: this is needed until core starts ignoring "delete_server_after" for chatmail
if (ac.isChatmail()) {
ac.setConfig("delete_server_after", null); // reset
}
}
if (allAccounts.length == 0) {
try {
@@ -57,7 +57,7 @@ public class AdvancedPreferenceFragment extends ListSummaryPreferenceFragment
private static final String TAG = AdvancedPreferenceFragment.class.getSimpleName();
private ListPreference showEmails;
CheckBoxPreference bccSelfCheckbox;
CheckBoxPreference multiDeviceCheckbox;
CheckBoxPreference mvboxMoveCheckbox;
CheckBoxPreference onlyFetchMvboxCheckbox;
CheckBoxPreference webxdcRealtimeCheckbox;
@@ -76,9 +76,9 @@ public class AdvancedPreferenceFragment extends ListSummaryPreferenceFragment
});
}
bccSelfCheckbox = (CheckBoxPreference) this.findPreference("pref_bcc_self");
if (bccSelfCheckbox != null) {
bccSelfCheckbox.setOnPreferenceChangeListener((preference, newValue) -> {
multiDeviceCheckbox = (CheckBoxPreference) this.findPreference("pref_bcc_self");
if (multiDeviceCheckbox != null) {
multiDeviceCheckbox.setOnPreferenceChangeListener((preference, newValue) -> {
boolean enabled = (Boolean) newValue;
dcContext.setConfigInt(CONFIG_BCC_SELF, enabled? 1 : 0);
return true;
@@ -227,7 +227,6 @@ public class AdvancedPreferenceFragment extends ListSummaryPreferenceFragment
if (dcContext.isChatmail()) {
showEmails.setVisible(false);
showSystemContacts.setVisible(false);
bccSelfCheckbox.setVisible(false);
mvboxMoveCheckbox.setVisible(false);
onlyFetchMvboxCheckbox.setVisible(false);
}
@@ -247,7 +246,7 @@ public class AdvancedPreferenceFragment extends ListSummaryPreferenceFragment
showEmails.setValue(value);
updateListSummary(showEmails, value);
bccSelfCheckbox.setChecked(0!=dcContext.getConfigInt(CONFIG_BCC_SELF));
multiDeviceCheckbox.setChecked(0!=dcContext.getConfigInt(CONFIG_BCC_SELF));
mvboxMoveCheckbox.setChecked(0!=dcContext.getConfigInt(CONFIG_MVBOX_MOVE));
onlyFetchMvboxCheckbox.setChecked(0!=dcContext.getConfigInt(CONFIG_ONLY_FETCH_MVBOX));
webxdcRealtimeCheckbox.setChecked(0!=dcContext.getConfigInt(CONFIG_WEBXDC_REALTIME_ENABLED));
@@ -81,11 +81,7 @@ public class ChatsPreferenceFragment extends ListSummaryPreferenceFragment {
autoDelServer.setOnPreferenceChangeListener(new AutodelChangeListener("delete_server_after"));
}
if (dcContext.isChatmail()) {
autoDelServer.setEntries(new CharSequence[]{getString(R.string.automatic), getString(R.string.autodel_at_once)});
autoDelServer.setEntryValues(new CharSequence[]{"0", "1"});
if (dcContext.getConfigInt("delete_server_after") > 1) {
dcContext.setConfigInt("delete_server_after", 0 /*never/automatic*/);
}
autoDelServer.setVisible(false);
}
}
+2 -2
View File
@@ -803,8 +803,8 @@
<string name="pref_imap_folder_warn_disable_defaults">If you change this option, make sure, your server and your other clients are configured accordingly.\n\nOtherwise things may not work at all.</string>
<!-- deprecated -->
<string name="pref_watch_sent_folder">Watch Sent Folder</string>
<string name="pref_send_copy_to_self">Send Copy to Self</string>
<string name="pref_send_copy_to_self_explain">Required when using this account on multiple devices.</string>
<string name="pref_send_copy_to_self">Multi-device Mode</string>
<string name="pref_send_copy_to_self_explain">Required when using this profile on multiple devices.</string>
<string name="pref_auto_folder_moves">Move automatically to DeltaChat Folder</string>
<string name="pref_auto_folder_moves_explain">Chat conversations are moved to avoid cluttering the Inbox</string>
<string name="pref_only_fetch_mvbox_title">Only Fetch from DeltaChat Folder</string>
+2 -1
View File
@@ -79,7 +79,8 @@
<org.thoughtcrime.securesms.components.SwitchPreferenceCompat
android:defaultValue="true"
android:key="pref_bcc_self"
android:title="@string/pref_send_copy_to_self"/>
android:title="@string/pref_send_copy_to_self"
android:summary="@string/pref_send_copy_to_self_explain"/>
<org.thoughtcrime.securesms.components.SwitchPreferenceCompat
android:defaultValue="true"