Allow disabling confirmation of permanent deletion of single messages

This commit is contained in:
M66B 2021-08-05 21:29:09 +02:00
parent afc75dd86a
commit d1c47466ae
1 changed files with 16 additions and 1 deletions

View File

@ -3845,11 +3845,26 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
Bundle aargs = new Bundle();
aargs.putString("question", getResources()
.getQuantityString(R.plurals.title_deleting_messages, ids.size(), ids.size()));
aargs.putString("remark", getString(R.string.title_no_undo));
aargs.putInt("faq", 160);
if (ids.size() == 1) {
aargs.putString("notagain", "delete_asked");
aargs.putString("accept", getString(R.string.title_ask_delete_accept));
} else
aargs.putString("remark", getString(R.string.title_no_undo));
aargs.putLongArray("ids", Helper.toLongArray(ids));
aargs.putBoolean("warning", true);
if (ids.size() == 1) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
boolean delete_asked = prefs.getBoolean("delete_asked", false);
if (delete_asked) {
Intent data = new Intent();
data.putExtra("args", aargs);
onActivityResult(REQUEST_MESSAGES_DELETE, RESULT_OK, data);
return;
}
}
FragmentDialogAsk ask = new FragmentDialogAsk();
ask.setArguments(aargs);
ask.setTargetFragment(FragmentMessages.this, REQUEST_MESSAGES_DELETE);