[evolution-ews/gnome-3-24] Bug 784332 - EXDATE missed in recurring events



commit a74b0e18b447636c2c1629440752550a2ec19371
Author: Milan Crha <mcrha redhat com>
Date:   Thu Jun 29 14:12:51 2017 +0200

    Bug 784332 - EXDATE missed in recurring events

 src/calendar/e-cal-backend-ews.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/src/calendar/e-cal-backend-ews.c b/src/calendar/e-cal-backend-ews.c
index 6e6d2ca..50dd5ae 100644
--- a/src/calendar/e-cal-backend-ews.c
+++ b/src/calendar/e-cal-backend-ews.c
@@ -3418,6 +3418,7 @@ add_item_to_cache (ECalBackendEws *cbews,
        if (icalcomp) {
                ECalComponent *comp, *cache_comp = NULL;
                icalproperty *icalprop, *freebusy;
+               struct icaltimetype itt;
                const EwsId *item_id;
                ECalComponentId *id;
                const GSList *l = NULL;
@@ -3522,6 +3523,22 @@ add_item_to_cache (ECalBackendEws *cbews,
                        }
                }
 
+               /* The EXDATE sent by the server can be date-time format with timezone, while
+                  the event start time can be date-only. This breaks the rules, thus correct
+                  it and make also EXDATE date-only. */
+               itt = icalcomponent_get_dtstart (icalcomp);
+               if (icaltime_is_valid_time (itt) && itt.is_date) {
+                       for (icalprop = icalcomponent_get_first_property (icalcomp, ICAL_EXDATE_PROPERTY);
+                            icalprop;
+                            icalprop = icalcomponent_get_next_property (icalcomp, ICAL_EXDATE_PROPERTY)) {
+                               itt = icalproperty_get_exdate (icalprop);
+                               itt.is_date = 1;
+                               icalproperty_set_exdate (icalprop, itt);
+
+                               icalproperty_remove_parameter_by_kind (icalprop, ICAL_TZID_PARAMETER);
+                       }
+               }
+
                /* Exchange sets an ORGANIZER on all events. RFC2445 says:
                 *
                 *   This property MUST NOT be specified in an iCalendar


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]