From 050cf4e61fd7036aed9f0a17e4599e0203eefb57 Mon Sep 17 00:00:00 2001 From: JP Rosevear Date: Wed, 22 Aug 2001 21:34:33 +0000 Subject: call back to add timezones to the top level (itip_send_comp): call 2001-08-22 JP Rosevear * gui/itip-utils.c (foreach_tzid_callback): call back to add timezones to the top level (itip_send_comp): call icalcomponent_foreach_tzid svn path=/trunk/; revision=12396 --- calendar/ChangeLog | 6 ++++++ calendar/gui/itip-utils.c | 29 ++++++++++++++++++++++++++++- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 8d53325150..87ed928311 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,9 @@ +2001-08-22 JP Rosevear + + * gui/itip-utils.c (foreach_tzid_callback): call back to add + timezones to the top level + (itip_send_comp): call icalcomponent_foreach_tzid + 2001-08-22 Dan Winship * gui/gnome-cal.c: #include so diff --git a/calendar/gui/itip-utils.c b/calendar/gui/itip-utils.c index 8b2e008a2a..828ee05aed 100644 --- a/calendar/gui/itip-utils.c +++ b/calendar/gui/itip-utils.c @@ -167,6 +167,32 @@ itip_strip_mailto (const gchar *address) return address; } +static void +foreach_tzid_callback (icalparameter *param, gpointer data) +{ + icalcomponent *icomp = data; + const char *tzid; + icaltimezone *zone; + icalcomponent *vtimezone_comp; + + /* Get the TZID string from the parameter. */ + tzid = icalparameter_get_tzid (param); + if (!tzid) + return; + + /* Check if it is a builtin timezone. If it isn't, return. */ + zone = icaltimezone_get_builtin_timezone_from_tzid (tzid); + if (!zone) + return; + + /* Convert it to a string and add it to the hash. */ + vtimezone_comp = icaltimezone_get_component (zone); + if (!vtimezone_comp) + return; + + icalcomponent_add_component (icomp, icalcomponent_new_clone (vtimezone_comp)); +} + void itip_send_comp (CalComponentItipMethod method, CalComponent *comp) { @@ -207,7 +233,6 @@ itip_send_comp (CalComponentItipMethod method, CalComponent *comp) for (cntr = 0, l = attendees; cntr < len; cntr++, l = l->next) { CalComponentAttendee *att = l->data; - gchar *real; recipient = &(to_list->_buffer[cntr]); if (att->cn) @@ -293,6 +318,8 @@ itip_send_comp (CalComponentItipMethod method, CalComponent *comp) clone = icalcomponent_new_clone (cal_component_get_icalcomponent (comp)); icalcomponent_add_component (icomp, clone); + icalcomponent_foreach_tzid (clone, foreach_tzid_callback, icomp); + ical_string = icalcomponent_as_ical_string (icomp); attach_data = GNOME_Evolution_Composer_AttachmentData__alloc (); attach_data->_maximum = attach_data->_length = strlen (ical_string); -- cgit v1.2.3