Added permanent message delete

pull/162/head
M66B 5 years ago
parent 3506cbf1ee
commit aeff4e3169

@ -1954,11 +1954,11 @@ However, not all servers support IMAP keywords and besides that there are no sta
<br />
<a name="faq108"></a>
**(108) Can you add permanently delete messages from any folder?**
**~~(108) Can you add permanently delete messages from any folder?~~**
When you delete messages from a folder the messages will be moved to the trash folder, so you have a chance to restore the messages.
You can permanently delete messages from the trash folder.
Permanently delete messages from other folders would defeat the purpose of the trash folder, so this will not be added.
~~When you delete messages from a folder the messages will be moved to the trash folder, so you have a chance to restore the messages.~~
~~You can permanently delete messages from the trash folder.~~
~~Permanently delete messages from other folders would defeat the purpose of the trash folder, so this will not be added.~~
<br />

@ -2412,7 +2412,6 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
popupMenu.getMenu().findItem(R.id.menu_flag_color).setEnabled(message.uid != null && !message.folderReadOnly);
popupMenu.getMenu().findItem(R.id.menu_copy).setEnabled(message.uid != null && !message.folderReadOnly);
popupMenu.getMenu().findItem(R.id.menu_delete).setVisible(debug);
popupMenu.getMenu().findItem(R.id.menu_junk).setEnabled(message.uid != null && !message.folderReadOnly);
popupMenu.getMenu().findItem(R.id.menu_junk).setVisible(hasJunk && !EntityFolder.JUNK.equals(message.folderType));
@ -2457,7 +2456,6 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
onActionMove(message, true);
return true;
case R.id.menu_delete:
// For emergencies
onMenuDelete(message);
return true;
case R.id.menu_junk:
@ -2836,24 +2834,14 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
}
private void onMenuDelete(final TupleMessageEx message) {
Bundle args = new Bundle();
args.putLong("id", message.id);
new SimpleTask<Void>() {
@Override
protected Void onExecute(Context context, Bundle args) {
long id = args.getLong("id");
DB db = DB.getInstance(context);
db.message().deleteMessage(id);
return null;
}
Bundle aargs = new Bundle();
aargs.putString("question", context.getString(R.string.title_ask_delete));
aargs.putLong("id", message.id);
@Override
protected void onException(Bundle args, Throwable ex) {
Helper.unexpectedError(parentFragment.getFragmentManager(), ex);
}
}.execute(context, owner, args, "message:delete");
FragmentDialogAsk ask = new FragmentDialogAsk();
ask.setArguments(aargs);
ask.setTargetFragment(parentFragment, FragmentMessages.REQUEST_MESSAGE_DELETE);
ask.show(parentFragment.getFragmentManager(), "message:delete");
}
private void onMenuJunk(final TupleMessageEx message) {

@ -3964,6 +3964,9 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
NotificationManager nm = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
nm.cancel("send:" + message.identity, 1);
}
} else if (message.uid == null) {
db.message().deleteMessage(id);
db.folder().setFolderError(message.folder, null);
} else
EntityOperation.queue(context, message, EntityOperation.DELETE);

Loading…
Cancel
Save