From: Art Cancro Date: Sat, 28 Dec 2002 05:33:29 +0000 (+0000) Subject: * ical_dezonify: set is_utc=1 even if we didn't convert from some arbitrary X-Git-Tag: v7.86~6063 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=61c34c396d216d135dbfaf7cb292d7deb06b6e16 * ical_dezonify: set is_utc=1 even if we didn't convert from some arbitrary timezone. Presumably this means the time was already UTC, and we really need that "Z" to get slapped on it. --- diff --git a/citadel/ChangeLog b/citadel/ChangeLog index 08c6c3bf2..804b20692 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -1,4 +1,9 @@ $Log$ + Revision 601.99 2002/12/28 05:33:29 ajc + * ical_dezonify: set is_utc=1 even if we didn't convert from some arbitrary + timezone. Presumably this means the time was already UTC, and we really + need that "Z" to get slapped on it. + Revision 601.98 2002/12/28 05:12:06 ajc * Yet another attempt at making ical_dezonify() send outgoing calendar items in UTC format. (This one will probably work -- the timestamps have the @@ -4337,3 +4342,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant Fri Jul 10 1998 Art Cancro * Initial CVS import + diff --git a/citadel/ical_dezonify.c b/citadel/ical_dezonify.c index f7ead4e3d..a0801e08b 100644 --- a/citadel/ical_dezonify.c +++ b/citadel/ical_dezonify.c @@ -38,7 +38,7 @@ void ical_dezonify_backend(icalcomponent *cal, icalcomponent *rcal, icalproperty *prop) { - icaltimezone *t; + icaltimezone *t = NULL; icalparameter *param; const char *tzid; struct icaltimetype TheTime; @@ -48,15 +48,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. */ @@ -77,10 +79,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);