Use account/folder name for mbix file name

This commit is contained in:
M66B 2021-04-17 21:18:40 +02:00
parent 07b005d586
commit eba065fb02
1 changed files with 6 additions and 2 deletions

View File

@ -942,11 +942,15 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
}
private void onActionExportMessages() {
String filename = Helper.sanitizeFilename(
folder.accountName.replace(" ", "_") + "_" +
folder.getDisplayName(context).replace(" ", "_") + "_" +
new SimpleDateFormat("yyyyMMdd").format(new Date().getTime()) + ".mbox");
Intent intent = new Intent(Intent.ACTION_CREATE_DOCUMENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setType("*/*");
intent.putExtra(Intent.EXTRA_TITLE, "fairemail_" +
new SimpleDateFormat("yyyyMMdd").format(new Date().getTime()) + ".mbox");
intent.putExtra(Intent.EXTRA_TITLE, filename);
Helper.openAdvanced(intent);
if (intent.resolveActivity(context.getPackageManager()) == null) { // // system/GET_CONTENT whitelisted