X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fserv_calendar.c;h=c58502bbe0e489111a13271bc2edc0dcab4a6332;hb=809cf4fc010629e54cdeabdc6e1920a33ae7d6e5;hp=2e8acf5a55b140086210cd267be61f64e8cbc6ef;hpb=430e6f04465553b99a605ff923ce6103086084e9;p=citadel.git diff --git a/citadel/serv_calendar.c b/citadel/serv_calendar.c index 2e8acf5a5..c58502bbe 100644 --- a/citadel/serv_calendar.c +++ b/citadel/serv_calendar.c @@ -1046,6 +1046,8 @@ void ical_create_room(void) */ void ical_send_out_invitations(icalcomponent *cal) { icalcomponent *the_request = NULL; + icaltimezone *utc_timezone = NULL; + icalcomponent *utc_component = NULL; char *serialized_request = NULL; char *request_message_text = NULL; struct CtdlMessage *msg = NULL; @@ -1127,7 +1129,29 @@ void ical_send_out_invitations(icalcomponent *cal) { /* Set the method to REQUEST */ icalcomponent_set_method(encaps, ICAL_METHOD_REQUEST); - /* FIXME: here we need to insert a VTIMEZONE object. */ + /* Insert a VTIMEZONE subcomponent telling the dumbass calendar agent + * at the other end about UTC. This is necessary because some calendar + * agents assume that an unqualified time is UTC while others assume + * it is local. + */ + utc_timezone = icaltimezone_get_utc_timezone(); + if (utc_timezone == NULL) { + lprintf(9, "%s:%d: utc_timezone is null\n",__FILE__,__LINE__); + } + else { + utc_component = icaltimezone_get_component(utc_timezone); + } + if (utc_component == NULL) { + lprintf(9, "%s:%d: utc_component is null\n",__FILE__,__LINE__); + } + else { + icalcomponent_add_component(encaps, utc_component); + } + + /* Now make sure all of the DTSTART and DTEND properties are + * labelled as UTC. (FIXME do this) + */ + ical_dezonify(the_request); /* Here we go: put the VEVENT into the VCALENDAR. We now no longer * are responsible for "the_request"'s memory -- it will be freed