* Update ical_dezonify() to use system tzdata
[citadel.git] / citadel / modules / calendar / serv_calendar.c
index 111e0d8f338a6b4376bc7fd3de3ea35c46d6beef..b1610c7fecaad4efce96041a7a8888f802ec3e7e 100644 (file)
@@ -87,11 +87,6 @@ icalcomponent *ical_encapsulate_subcomponent(icalcomponent *subcomp) {
        /* Encapsulate the subcomponent inside */
        icalcomponent_add_component(encaps, subcomp);
 
-       /* Convert all timestamps to UTC so we don't have to deal with
-        * stupid VTIMEZONE crap.
-        */
-       ical_dezonify(encaps);
-
        /* Return the object we just created. */
        return(encaps);
 }
@@ -174,6 +169,15 @@ void ical_write_to_cal(struct ctdluser *u, icalcomponent *cal) {
 void ical_add(icalcomponent *cal, int recursion_level) {
        icalcomponent *c;
 
+#if 1
+       /* Write the whole thing because it may need to save timezones etc.
+        * FIXME - if this works, we can probably eliminate this entire function
+        */
+
+       ical_write_to_cal(&CC->user, cal);
+
+#else  /* this was the old code to kill everything but the VEVENT component ... probably ng now */
+
        /*
         * The VEVENT subcomponent is the one we're interested in saving.
         */
@@ -190,6 +194,7 @@ void ical_add(icalcomponent *cal, int recursion_level) {
                /* Recursively process subcomponent */
                ical_add(c, recursion_level+1);
        }
+#endif
 
 }
 
@@ -382,9 +387,6 @@ void ical_locate_part(char *name, char *filename, char *partnum, char *disp,
        }
 
        ird->cal = icalcomponent_new_from_string(content);
-       if (ird->cal != NULL) {
-               ical_dezonify(ird->cal);
-       }
 }
 
 
@@ -1214,8 +1216,6 @@ void ical_add_to_freebusy(icalcomponent *fb, icalcomponent *cal) {
                return;
        }
 
-       ical_dezonify(cal);
-
        /* If this event is not opaque, the user isn't publishing it as
         * busy time, so don't bother doing anything else.
         */
@@ -1625,7 +1625,6 @@ void ical_putics(void)
 
        cal = icalcomponent_new_from_string(calstream);
        free(calstream);
-       ical_dezonify(cal);
 
        /* We got our data stream -- now do something with it. */
 
@@ -1896,9 +1895,6 @@ void ical_send_out_invitations(icalcomponent *cal) {
        /* Set the method to REQUEST */
        icalcomponent_set_method(encaps, ICAL_METHOD_REQUEST);
 
-       /* Now make sure all of the DTSTART and DTEND properties are UTC. */
-       ical_dezonify(the_request);
-
        /* Here we go: put the VEVENT into the VCALENDAR.  We now no longer
         * are responsible for "the_request"'s memory -- it will be freed
         * when we free "encaps".
@@ -2294,7 +2290,6 @@ void ical_fixed_output(char *ptr, int len) {
                return;
        }
 
-       ical_dezonify(cal);
        ical_fixed_output_backend(cal, 0);
 
        /* Free the memory we obtained from libical's constructor */