From e9616439ace3c5a57e4c08ddb753bf1c4146f634 Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 26 Oct 2023 12:52:09 +0200 Subject: [PATCH] Revert "Process event attendee reply status" This reverts commit 01d1b1070c6a45ff042ee19803dbbc5d6c358c9c. --- .../java/eu/faircode/email/MessageHelper.java | 30 +++++-------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/MessageHelper.java b/app/src/main/java/eu/faircode/email/MessageHelper.java index 7205204ce1..1f99463d05 100644 --- a/app/src/main/java/eu/faircode/email/MessageHelper.java +++ b/app/src/main/java/eu/faircode/email/MessageHelper.java @@ -158,9 +158,8 @@ import javax.mail.internet.ParseException; import biweekly.Biweekly; import biweekly.ICalendar; import biweekly.component.VEvent; -import biweekly.parameter.ParticipationStatus; -import biweekly.property.Attendee; import biweekly.property.Method; +import biweekly.property.Status; import ezvcard.VCard; import ezvcard.VCardVersion; import ezvcard.io.text.VCardWriter; @@ -4454,27 +4453,12 @@ public class MessageHelper { else if (method == null || method.isRequest() || method.isReply()) { int status = CalendarContract.Events.STATUS_TENTATIVE; if (method != null && method.isReply()) { - List attendees = event.getAttendees(); - if (attendees != null && message.to != null) - for (Attendee attendee : attendees) { - String email = attendee.getEmail(); - for (Address to : message.to) { - String recipient = ((InternetAddress) to).getAddress(); - if (!TextUtils.isEmpty(email) && email.equalsIgnoreCase(recipient)) { - ParticipationStatus pstatus = attendee.getParticipationStatus(); - if (ParticipationStatus.ACCEPTED.equals(pstatus)) - status = CalendarContract.Events.STATUS_CONFIRMED; - else if (ParticipationStatus.DECLINED.equals(pstatus)) - status = CalendarContract.Events.STATUS_CANCELED; - break; - } - } - } - } - - if (status == CalendarContract.Events.STATUS_CANCELED) { - CalendarHelper.delete(context, event, message); - return; + Status istatus = event.getStatus(); + if (istatus != null) + if (Status.ACCEPTED.equals(istatus.getValue())) + status = CalendarContract.Events.STATUS_CONFIRMED; + else if (Status.CANCELLED.equals(istatus.getValue())) + status = CalendarContract.Events.STATUS_CANCELED; } if (status == CalendarContract.Events.STATUS_TENTATIVE && !ical_tentative) {