Allow moving trash / POP3 / leave deleted

pull/194/merge
M66B 3 years ago
parent d4e3d65ed6
commit 9b4c49099b

@ -1959,7 +1959,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
boolean archive = (move && (hasArchive && !inArchive && !inSent && !inTrash && !inJunk));
boolean trash = (move || outbox || debug ||
message.accountProtocol == EntityAccount.TYPE_POP);
boolean inbox = (move && hasInbox && (inArchive || inTrash || inJunk));
boolean inbox = (move && hasInbox && (inArchive || inTrash || inJunk)) ||
(message.accountProtocol == EntityAccount.TYPE_POP && message.accountLeaveDeleted && inTrash);
boolean keywords = (message.uid != null &&
message.accountProtocol == EntityAccount.TYPE_IMAP);
boolean labels = (data.isGmail && move && !inTrash && !inJunk && !outbox);

@ -358,7 +358,7 @@ class Core {
break;
case EntityOperation.MOVE:
onMove(context, jargs, folder, message);
onMove(context, jargs, account, folder, message);
break;
case EntityOperation.DELETE:
@ -1496,7 +1496,7 @@ class Core {
}
}
private static void onMove(Context context, JSONArray jargs, EntityFolder folder, EntityMessage message) throws JSONException, FolderNotFoundException {
private static void onMove(Context context, JSONArray jargs, EntityAccount account, EntityFolder folder, EntityMessage message) throws JSONException, FolderNotFoundException {
// Move message
DB db = DB.getInstance(context);
@ -1513,10 +1513,11 @@ class Core {
throw new IllegalArgumentException("self");
// Move from trash/drafts only
if (!EntityFolder.TRASH.equals(folder.type) &&
!EntityFolder.DRAFTS.equals(folder.type))
if (!EntityFolder.DRAFTS.equals(folder.type) &&
!(EntityFolder.TRASH.equals(folder.type) && account.leave_deleted))
throw new IllegalArgumentException("Invalid POP3 folder" +
" source=" + folder.type + " target=" + target.type);
" source=" + folder.type + " target=" + target.type +
" leave deleted=" + account.leave_deleted);
message.folder = target.id;
if (seen)

@ -3292,7 +3292,8 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
.setIcon(R.drawable.twotone_attachment_24);
if (!result.read_only) {
if (result.hasInbox && !result.isInbox) // not is inbox
if ((result.hasInbox && !result.isInbox) ||
(result.leave_deleted != null && result.leave_deleted && result.isTrash)) // not is inbox
popupMenu.getMenu().add(Menu.FIRST, R.string.title_folder_inbox, order++, R.string.title_folder_inbox)
.setIcon(R.drawable.twotone_move_to_inbox_24);

Loading…
Cancel
Save