* make readloop long-controlled
[citadel.git] / webcit / event.c
index f1af019dbb6afff84365517749c185359720bab4..0258c2ffc828b1ff459fae8a85f88dd67ca0831c 100644 (file)
@@ -71,6 +71,10 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum,
 
        if (supplied_vevent != NULL) {
                vevent = supplied_vevent;
+
+               /* Convert all timestamps to UTC to make them easier to process. */
+               ical_dezonify(vevent);
+
                /*
                 * If we're looking at a fully encapsulated VCALENDAR
                 * rather than a VEVENT component, attempt to use the first
@@ -756,6 +760,10 @@ void save_individual_event(icalcomponent *supplied_vevent, long msgnum, char *fr
 
        if (supplied_vevent != NULL) {
                vevent = supplied_vevent;
+
+               /* Convert all timestamps to UTC to make them easier to process. */
+               ical_dezonify(vevent);
+
                /*
                 * If we're looking at a fully encapsulated VCALENDAR
                 * rather than a VEVENT component, attempt to use the first
@@ -837,16 +845,10 @@ void save_individual_event(icalcomponent *supplied_vevent, long msgnum, char *fr
                        icaltime_from_webform(&event_start, "dtstart");
                }
 
-               /*
-                * The following odd-looking snippet of code looks like it
-                * takes some unnecessary steps.  It is done this way because
-                * libical incorrectly turns an "all day event" into a normal
-                * event starting at midnight (i.e. it serializes as date/time
-                * instead of just date) unless icalvalue_new_date() is used.
-                * So we force it, if this is an all day event.
-                */
                prop = icalproperty_new_dtstart(event_start);
+
                if (all_day_event) {
+                       /* Force it to serialize as a date-only rather than date/time */
                        icalproperty_set_value(prop, icalvalue_new_date(event_start));
                }
 
@@ -1016,7 +1018,11 @@ void save_individual_event(icalcomponent *supplied_vevent, long msgnum, char *fr
 
                /* First, strip out the parenthesized partstats.  */
                strcpy(form_attendees, bstr("attendees"));
-               stripout(form_attendees, '(', ')');
+               do {
+                       i = strlen(form_attendees);
+                       stripout(form_attendees, '(', ')');
+                       j = strlen(form_attendees);
+               } while (i != j);
 
                /* Next, change any commas to newlines, because we want newline-separated attendees. */
                j = strlen(form_attendees);
@@ -1141,6 +1147,6 @@ STARTOVER:        for (attendee = icalcomponent_get_first_property(vevent, ICAL_ATTENDE
 
        /* If this was a save or delete, go back to the calendar view. */
        if (!havebstr("check_button")) {
-               readloop("readfwd");
+               readloop(readfwd);
        }
 }