Use temporary calendar files

This commit is contained in:
M66B
2019-07-31 09:40:54 +02:00
parent f0456e1a41
commit 0fa78c3e66
2 changed files with 2 additions and 5 deletions

View File

@@ -1364,10 +1364,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
response.setMethod(Method.REPLY);
response.addEvent(ev);
File dir = new File(context.getFilesDir(), "temporary");
if (!dir.exists())
dir.mkdir();
File ics = new File(dir, "meeting.ics");
File ics = File.createTempFile(Long.toString(attachment.id), ".ics", context.getCacheDir());
response.write(ics);
return ics;

View File

@@ -2179,7 +2179,7 @@ public class FragmentCompose extends FragmentBase {
EntityAttachment attachment = new EntityAttachment();
attachment.message = draft.id;
attachment.sequence = 1;
attachment.name = ics.getName();
attachment.name = "meeting.ics";
attachment.type = "text/calendar";
attachment.disposition = Part.ATTACHMENT;
attachment.size = ics.length();