From: Art Cancro Date: Sat, 28 Dec 2002 05:44:09 +0000 (+0000) Subject: * ical_dezonify.c: brought over new version from the Citadel source (again) X-Git-Tag: v7.86~6062 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=884b144e0360c11e8bca79851c00bebe9b0237a6 * ical_dezonify.c: brought over new version from the Citadel source (again) --- diff --git a/webcit/ChangeLog b/webcit/ChangeLog index dae1269f5..8ebddc81a 100644 --- a/webcit/ChangeLog +++ b/webcit/ChangeLog @@ -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 1998-12-03 Nathan Bryant * webserver.c: warning fix + diff --git a/webcit/event.c b/webcit/event.c index 446cfed7b..4bc59bca6 100644 --- a/webcit/event.c +++ b/webcit/event.c @@ -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); */ } diff --git a/webcit/ical_dezonify.c b/webcit/ical_dezonify.c index 751b80e81..ab0d725a9 100644 --- a/webcit/ical_dezonify.c +++ b/webcit/ical_dezonify.c @@ -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);