Allow deleting 3 messages permanently

pull/198/head
M66B 3 years ago
parent b26328cd3c
commit 4606198cb6

@ -335,6 +335,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
private NumberFormat NF = NumberFormat.getNumberInstance();
private static final int MAX_MORE = 100; // messages
private static final int MAX_PERMANENT_DELETE = 3; // messages
private static final int MAX_SEND_RAW = 50; // messages
private static final int SWIPE_DISABLE_SELECT_DURATION = 1500; // milliseconds
private static final float LUMINANCE_THRESHOLD = 0.7f;
@ -2883,7 +2884,8 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
if (result.hasArchive && !result.isArchive) // has archive and not is archive
popupMenu.getMenu().add(Menu.NONE, R.string.title_archive, order++, R.string.title_archive);
if (result.isTrash || !result.hasTrash || result.isJunk) // is trash or no trash or is junk
if (result.isTrash || !result.hasTrash || result.isJunk ||
ids.length <= MAX_PERMANENT_DELETE) // is trash or no trash or is junk
popupMenu.getMenu().add(Menu.NONE, R.string.title_delete, order++, R.string.title_delete);
if (!result.isTrash && result.hasTrash && !result.isJunk) // not trash and has trash and not is junk
@ -3287,6 +3289,7 @@ 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.putLongArray("ids", Helper.toLongArray(ids));
aargs.putBoolean("warning", true);
@ -3667,6 +3670,7 @@ 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.putLongArray("ids", Helper.toLongArray(ids));
aargs.putBoolean("warning", true);

@ -944,6 +944,7 @@
<string name="title_move_to_account">Move to %1$s &#8230;</string>
<string name="title_report_spam">Treat as spam</string>
<string name="title_delete_permanently">Delete permanently</string>
<string name="title_no_undo">This cannot be undone!</string>
<string name="title_snooze">Snooze &#8230;</string>
<string name="title_archive">Archive</string>
<string name="title_reply">Reply</string>

Loading…
Cancel
Save