1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2025-01-01 12:44:42 +00:00

Use subject as EML filename

This commit is contained in:
M66B 2020-04-28 14:59:34 +02:00
parent d1ce1b6e7f
commit c0c322afc9
2 changed files with 6 additions and 2 deletions

View file

@ -4244,7 +4244,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(context);
lbm.sendBroadcast(
new Intent(FragmentMessages.ACTION_STORE_RAW)
.putExtra("id", message.id));
.putExtra("id", message.id)
.putExtra("subject", message.subject));
}
}

View file

@ -4816,10 +4816,13 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
private void onStoreRaw(Intent intent) {
message = intent.getLongExtra("id", -1);
String subject = intent.getStringExtra("subject");
String name = (TextUtils.isEmpty(subject) ? "email" : Helper.sanitizeFilename(subject)) + ".eml";
Intent create = new Intent(Intent.ACTION_CREATE_DOCUMENT);
create.addCategory(Intent.CATEGORY_OPENABLE);
create.setType("*/*");
create.putExtra(Intent.EXTRA_TITLE, "email.eml");
create.putExtra(Intent.EXTRA_TITLE, name);
Helper.openAdvanced(create);
if (create.resolveActivity(getContext().getPackageManager()) == null)
Snackbar.make(view, R.string.title_no_saf, Snackbar.LENGTH_LONG).show();