mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
Merge pull request #4007 from deltachat/adb/remove-deprecated-advanced-section
remove deprecated/broken `send_autocrypt_setup_message` advanced preference
This commit is contained in:
@@ -76,11 +76,6 @@ public class AdvancedPreferenceFragment extends ListSummaryPreferenceFragment
|
||||
});
|
||||
}
|
||||
|
||||
Preference sendAsm = this.findPreference("pref_send_autocrypt_setup_message");
|
||||
if (sendAsm != null) {
|
||||
sendAsm.setOnPreferenceClickListener(new SendAsmListener());
|
||||
}
|
||||
|
||||
bccSelfCheckbox = (CheckBoxPreference) this.findPreference("pref_bcc_self");
|
||||
if (bccSelfCheckbox != null) {
|
||||
bccSelfCheckbox.setOnPreferenceChangeListener((preference, newValue) -> {
|
||||
@@ -345,39 +340,4 @@ public class AdvancedPreferenceFragment extends ListSummaryPreferenceFragment
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
/***********************************************************************************************
|
||||
* Autocrypt
|
||||
**********************************************************************************************/
|
||||
|
||||
private class SendAsmListener implements Preference.OnPreferenceClickListener {
|
||||
@Override
|
||||
public boolean onPreferenceClick(@NonNull Preference preference) {
|
||||
Activity activity = requireActivity();
|
||||
new AlertDialog.Builder(activity)
|
||||
.setTitle(activity.getString(R.string.autocrypt_send_asm_title))
|
||||
.setMessage(activity.getString(R.string.autocrypt_send_asm_explain_before))
|
||||
.setNegativeButton(android.R.string.cancel, null)
|
||||
.setPositiveButton(R.string.autocrypt_send_asm_button, (dialog, which) -> {
|
||||
final String sc = dcContext.initiateKeyTransfer();
|
||||
if( sc != null ) {
|
||||
String scFormatted = "";
|
||||
try {
|
||||
scFormatted = sc.substring(0, 4) + " - " + sc.substring(5, 9) + " - " + sc.substring(10, 14) + " -\n\n" +
|
||||
sc.substring(15, 19) + " - " + sc.substring(20, 24) + " - " + sc.substring(25, 29) + " -\n\n" +
|
||||
sc.substring(30, 34) + " - " + sc.substring(35, 39) + " - " + sc.substring(40, 44);
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "Unexpected exception", e);
|
||||
}
|
||||
new AlertDialog.Builder(activity)
|
||||
.setTitle(activity.getString(R.string.autocrypt_send_asm_title))
|
||||
.setMessage(activity.getString(R.string.autocrypt_send_asm_explain_after) + "\n\n" + scFormatted)
|
||||
.setPositiveButton(android.R.string.ok, null)
|
||||
.setCancelable(false) // prevent the dialog from being dismissed accidentally (when the dialog is closed, the setup code is gone forever and the user has to create a new setup message)
|
||||
.show();
|
||||
}
|
||||
})
|
||||
.show();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,15 +62,6 @@
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
android:key="pref_category_encryption"
|
||||
android:title="@string/pref_encryption">
|
||||
|
||||
<Preference android:key="pref_send_autocrypt_setup_message"
|
||||
android:title="@string/autocrypt_send_asm_title"/>
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory android:title="@string/pref_server">
|
||||
|
||||
<Preference android:key="password_account_settings_button"
|
||||
|
||||
Reference in New Issue
Block a user