Event reply: copy calendar scale

This commit is contained in:
M66B 2023-03-31 11:47:28 +02:00
parent a28a049361
commit f1b6d6a80f
1 changed files with 4 additions and 1 deletions

View File

@ -3733,6 +3733,9 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
if (attachment.available && "text/calendar".equals(attachment.getMimeType())) {
File file = attachment.getFile(context);
ICalendar icalendar = Biweekly.parse(file).first();
CalendarScale scale = (icalendar.getCalendarScale() == null
? CalendarScale.gregorian()
: icalendar.getCalendarScale());
VEvent event = icalendar.getEvents().get(0);
if (action == R.id.ibCalendar) {
@ -3912,7 +3915,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
// https://icalendar.org/validator.html
ICalendar response = new ICalendar();
response.setCalendarScale(CalendarScale.gregorian());
response.setCalendarScale(scale);
response.setMethod(Method.REPLY);
response.addEvent(ev);