libical3 compatibility , patches submitted by Adrian Bunk
authorArt Cancro <ajc@citadel.org>
Thu, 5 Apr 2018 02:42:16 +0000 (22:42 -0400)
committerArt Cancro <ajc@citadel.org>
Thu, 5 Apr 2018 02:42:16 +0000 (22:42 -0400)
citadel/ical_dezonify.c
citadel/modules/calendar/serv_calendar.c
webcit/calendar_tools.c
webcit/calendar_view.c
webcit/event.c
webcit/ical_dezonify.c

index f3425acd92be3d3e523b5147acda9414cebd42fe..04d41e7c90b0887cd5c2b02dac946bd8028d4c4c 100644 (file)
@@ -135,13 +135,13 @@ void ical_dezonify_backend(icalcomponent *cal,
 
        /* syslog(LOG_DEBUG, "                * Was: %s\n", icaltime_as_ical_string(TheTime)); */
 
-       if (TheTime.is_utc) {
+       if (icaltime_is_utc(TheTime)) {
                /* syslog(LOG_DEBUG, "                * This property is ALREADY UTC.\n"); */
        }
 
        else if (utc_declared_as_tzid) {
                /* syslog(LOG_DEBUG, "                * Replacing '%s' TZID with 'Z' suffix.\n", tzid); */
-               TheTime.is_utc = 1;
+               TheTime.zone = icaltimezone_get_utc_timezone();
        }
 
        else {
@@ -161,7 +161,7 @@ void ical_dezonify_backend(icalcomponent *cal,
                                        t,
                                        icaltimezone_get_utc_timezone()
                );
-               TheTime.is_utc = 1;
+               TheTime.zone = icaltimezone_get_utc_timezone();
        }
 
        icalproperty_remove_parameter_by_kind(prop, ICAL_TZID_PARAMETER);
index b335dc1d97b8b6a2031fd094e0b18af98ef185b1..6c7071d4e55d33aa4b9080f3beff3964814a60a0 100644 (file)
@@ -234,7 +234,7 @@ void ical_send_a_reply(icalcomponent *request, char *action) {
                /* We found our own address in the attendee list. */
                if (me_attend) {
                        /* Change the partstat from NEEDS-ACTION to ACCEPT or DECLINE */
-                       icalproperty_remove_parameter(me_attend, ICAL_PARTSTAT_PARAMETER);
+                       icalproperty_remove_parameter_by_kind(me_attend, ICAL_PARTSTAT_PARAMETER);
 
                        if (!strcasecmp(action, "accept")) {
                                partstat = icalparameter_new_partstat(ICAL_PARTSTAT_ACCEPTED);
@@ -1369,7 +1369,6 @@ void ical_add_to_freebusy(icalcomponent *fb, icalcomponent *top_level_cal) {
                        if (!icaltime_is_null_time(dtend)) {
                                dtend = icaltime_add(dtstart, dur);
                                dtend.zone = dtstart.zone;
-                               dtend.is_utc = dtstart.is_utc;
                        }
                        ++num_recur;
                }
@@ -1519,7 +1518,7 @@ void ical_freebusy(char *who) {
        icalcomponent_set_method(fb, ICAL_METHOD_PUBLISH);
 
        /* Set the DTSTAMP to right now. */
-       icalcomponent_set_dtstamp(fb, icaltime_from_timet(time(NULL), 0));
+       icalcomponent_set_dtstamp(fb, icaltime_from_timet_with_zone(time(NULL), 0, icaltimezone_get_utc_timezone()));
 
        /* Add the user's email address as ORGANIZER */
        sprintf(buf, "MAILTO:%s", who);
@@ -1540,10 +1539,10 @@ void ical_freebusy(char *who) {
         * to yesterday and tomorrow as default values.
         */
        if (icalcomponent_get_first_property(fb, ICAL_DTSTART_PROPERTY) == NULL) {
-               icalcomponent_set_dtstart(fb, icaltime_from_timet(time(NULL)-86400L, 0));
+               icalcomponent_set_dtstart(fb, icaltime_from_timet_with_zone(time(NULL)-86400L, 0, icaltimezone_get_utc_timezone()));
        }
        if (icalcomponent_get_first_property(fb, ICAL_DTEND_PROPERTY) == NULL) {
-               icalcomponent_set_dtend(fb, icaltime_from_timet(time(NULL)+86400L, 0));
+               icalcomponent_set_dtend(fb, icaltime_from_timet_with_zone(time(NULL)+86400L, 0, icaltimezone_get_utc_timezone()));
        }
 
        /* Put the freebusy component into the calendar component */
index daefe82fd27dbe0b8d2b5f3d98cd2ff00ee9335d..86da183b8abcca7f6a8666b7e2b99a1ae1142fc5 100644 (file)
@@ -151,7 +151,6 @@ void icaltime_from_webform(struct icaltimetype *t, char *prefix) {
        t->minute = IBSTR(vname);
 
        /* time zone is set to the default zone for this server */
-       t->is_utc = 0;
        t->is_date = 0;
        t->zone = get_default_icaltimezone();
 }
@@ -170,7 +169,7 @@ void icaltime_from_webform_dateonly(struct icaltimetype *t, char *prefix) {
        sscanf((char*)BSTR(prefix), "%04d-%02d-%02d", &t->year, &t->month, &t->day);
 
        /* time zone is set to the default zone for this server */
-       t->is_utc = 1;
+       t->zone = icaltimezone_get_utc_timezone();
        t->is_date = 1;
 }
 
index 03e80e5d15c1f4b2daf99047e4a5ae3005daeb40..1b6e8681ebe2f9f3f2deeeb3ef7b5cf666f403c7 100644 (file)
@@ -198,7 +198,6 @@ void calendar_month_view_display_events(int year, int month, int day)
        starting_tm.tm_hour = 0;
        starting_tm.tm_min = 0;
        today_start_t = icaltime_from_timet_with_zone(mktime(&starting_tm), 0, icaltimezone_get_utc_timezone());
-       today_start_t.is_utc = 1;
 
        memset(&ending_tm, 0, sizeof(struct tm));
        ending_tm.tm_year = year - 1900;
@@ -207,7 +206,6 @@ void calendar_month_view_display_events(int year, int month, int day)
        ending_tm.tm_hour = 23;
        ending_tm.tm_min = 59;
        today_end_t = icaltime_from_timet_with_zone(mktime(&ending_tm), 0, icaltimezone_get_utc_timezone());
-       today_end_t.is_utc = 1;
 
        /*
         * Create another one without caring about the timezone for all day events.
@@ -854,7 +852,6 @@ void calendar_day_view_display_events(time_t thetime,
        starting_tm.tm_hour = 0;
        starting_tm.tm_min = 0;
        today_start_t = icaltime_from_timet_with_zone(mktime(&starting_tm), 0, icaltimezone_get_utc_timezone());
-       today_start_t.is_utc = 1;
 
        memset(&ending_tm, 0, sizeof(struct tm));
        ending_tm.tm_year = year - 1900;
@@ -863,7 +860,6 @@ void calendar_day_view_display_events(time_t thetime,
        ending_tm.tm_hour = 23;
        ending_tm.tm_min = 59;
        today_end_t = icaltime_from_timet_with_zone(mktime(&ending_tm), 0, icaltimezone_get_utc_timezone());
-       today_end_t.is_utc = 1;
 
        /*
         * Create another one without caring about the timezone for all day events.
index 6f989a2379089f1dbacbc46a059794e96d6fddab..d786998ab8ef818c0d5bebf7e15b291c1b04b7e1 100644 (file)
@@ -264,8 +264,6 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum,
                        ((yesbstr("alldayevent")) ? 1 : 0),
                        icaltimezone_get_utc_timezone()
                );
-               t_start.is_utc = 1;
-
        }
        display_icaltimetype_as_webform(&t_start, "dtstart", 0);
 
@@ -854,8 +852,8 @@ void save_individual_event(icalcomponent *supplied_vevent, long msgnum, char *fr
 
                /* Add NOW() to the calendar object... */
                icalcomponent_set_dtstamp(vevent,
-                                         icaltime_from_timet(
-                                                 time(NULL), 0));
+                                         icaltime_from_timet_with_zone(
+                                                 time(NULL), 0, icaltimezone_get_utc_timezone()));
 
                if (havebstr("summary")) {
                        icalcomponent_add_property(vevent,
index 537bcc3e15770937187811de6e987baa6918767d..de444a9d5522a791e5a56083c0195b9de0323dcf 100644 (file)
@@ -116,7 +116,7 @@ void ical_dezonify_backend(icalcomponent *cal,
        syslog(LOG_DEBUG, "                * Was: %s\n", icaltime_as_ical_string(TheTime));
 #endif
 
-       if (TheTime.is_utc) {
+       if (icaltime_is_utc(TheTime)) {
 #ifdef DBG_ICAL
                syslog(LOG_DEBUG, "                * This property is ALREADY UTC.\n");
 #endif
@@ -126,7 +126,7 @@ void ical_dezonify_backend(icalcomponent *cal,
 #ifdef DBG_ICAL
                syslog(LOG_DEBUG, "                * Replacing '%s' TZID with 'Z' suffix.\n", tzid);
 #endif
-               TheTime.is_utc = 1;
+               TheTime.zone = icaltimezone_get_utc_timezone();
        }
 
        else {
@@ -146,7 +146,7 @@ void ical_dezonify_backend(icalcomponent *cal,
                        t = get_default_icaltimezone();
                }
                icaltimezone_convert_time(&TheTime, t, icaltimezone_get_utc_timezone());
-               TheTime.is_utc = 1;
+               TheTime.zone = icaltimezone_get_utc_timezone();
        }
 
        icalproperty_remove_parameter_by_kind(prop, ICAL_TZID_PARAMETER);