* ical_dezonify.c: brought over new version from the Citadel source (again)
authorArt Cancro <ajc@citadel.org>
Sat, 28 Dec 2002 05:44:09 +0000 (05:44 +0000)
committerArt Cancro <ajc@citadel.org>
Sat, 28 Dec 2002 05:44:09 +0000 (05:44 +0000)
webcit/ChangeLog
webcit/event.c
webcit/ical_dezonify.c

index dae1269f55da9c7e20d2fa064bcd43fca7dfc52b..8ebddc81af5bc6e46989f0715b74cd782c689d44 100644 (file)
@@ -1,4 +1,7 @@
 $Log$
+Revision 400.73  2002/12/28 05:44:09  ajc
+* ical_dezonify.c: brought over new version from the Citadel source (again)
+
 Revision 400.72  2002/12/28 05:12:45  ajc
 * ical_dezonify.c: brought over new version from the Citadel source.
 
@@ -1205,3 +1208,4 @@ Sun Dec  6 19:50:55 EST 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
 
 1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
        * webserver.c: warning fix
+
index 446cfed7b832e1378543d9bc3711f29adffc6bca..4bc59bca6b1790766266d1252a03ba9c0d42d8ed 100644 (file)
@@ -48,7 +48,7 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum)
        int organizer_is_me = 0;
        int sequence = 0;
 
-       now = time(NULL);
+       now = time(NULL) % 60;  /* mod 60 to force :00 seconds */
        strcpy(organizer_string, "");
        strcpy(attendee_string, "");
 
@@ -138,12 +138,13 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum)
                if (strlen(bstr("hour")) > 0) {
                        t_start.hour = atoi(bstr("hour"));
                        t_start.minute = atoi(bstr("minute"));
+                       t_start.second = 0;
                }
                else {
                        t_start.hour = 9;
                        t_start.minute = 0;
+                       t_start.second = 0;
                }
-               /* t_start = icaltime_from_timet(now, 0); */
        }
        display_icaltimetype_as_webform(&t_start, "dtstart");
 
@@ -201,6 +202,7 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum)
                         */
                        t_end = t_start;
                        t_end.hour += 1;
+                       t_end.second = 0;
                        t_end = icaltime_normalize(t_end);
                        /* t_end = icaltime_from_timet(now, 0); */
                }
index 751b80e8142184de3fcf50a0ff61ffa80804739b..ab0d725a99307839d845584fb1105af0b345c477 100644 (file)
@@ -31,7 +31,7 @@ void ical_dezonify_backend(icalcomponent *cal,
                        icalcomponent *rcal,
                        icalproperty *prop) {
 
-       icaltimezone *t;
+       icaltimezone *t = NULL;
        icalparameter *param;
        const char *tzid;
        struct icaltimetype TheTime;
@@ -41,15 +41,17 @@ void ical_dezonify_backend(icalcomponent *cal,
 
        /* Hunt for a TZID parameter in this property. */
        param = icalproperty_get_first_parameter(prop, ICAL_TZID_PARAMETER);
-       if (param == NULL) return;
 
        /* Get the stringish name of this TZID. */
-       tzid = icalparameter_get_tzid(param);
-       if (tzid == NULL) return;
+       if (param != NULL) {
+               tzid = icalparameter_get_tzid(param);
 
-       /* Convert it to an icaltimezone type. */
-       t = icalcomponent_get_timezone(cal, tzid);
-       if (t == NULL) return;
+               /* Convert it to an icaltimezone type. */
+               if (tzid != NULL) {
+                       t = icalcomponent_get_timezone(cal, tzid);
+               }
+
+       }
 
        /* Now we know the timezone.  Convert to UTC. */
 
@@ -70,10 +72,12 @@ void ical_dezonify_backend(icalcomponent *cal,
        }
 
        /* Do the conversion. */
-       icaltimezone_convert_time(&TheTime,
-                               t,
-                               icaltimezone_get_utc_timezone()
-       );
+       if (t != NULL) {
+               icaltimezone_convert_time(&TheTime,
+                                       t,
+                                       icaltimezone_get_utc_timezone()
+               );
+       }
        TheTime.is_utc = 1;
        icalproperty_remove_parameter_by_kind(prop, ICAL_TZID_PARAMETER);