while (prop = icalcomponent_get_first_property(vtodo,
ICAL_SUMMARY_PROPERTY), prop != NULL) {
icalcomponent_remove_property(vtodo, prop);
+ icalproperty_free(prop);
}
icalcomponent_add_property(vtodo,
icalproperty_new_summary(bstr("summary")));
while (prop = icalcomponent_get_first_property(vtodo,
ICAL_DESCRIPTION_PROPERTY), prop != NULL) {
icalcomponent_remove_property(vtodo, prop);
+ icalproperty_free(prop);
}
icalcomponent_add_property(vtodo,
icalproperty_new_description(bstr("description")));
while (prop = icalcomponent_get_first_property(vtodo,
ICAL_DTSTART_PROPERTY), prop != NULL) {
icalcomponent_remove_property(vtodo, prop);
+ icalproperty_free(prop);
}
icalcomponent_add_property(vtodo,
icalproperty_new_dtstart(
while (prop = icalcomponent_get_first_property(vtodo,
ICAL_DUE_PROPERTY), prop != NULL) {
icalcomponent_remove_property(vtodo, prop);
+ icalproperty_free(prop);
}
icalcomponent_add_property(vtodo,
icalproperty_new_due(
#ifdef HAVE_ICAL_H
-
/*
* Display an event by itself (for editing)
*/
struct icaltimetype t_start, t_end;
time_t now;
int created_new_vevent = 0;
+ icalorganizertype me_as_organizer;
icalproperty *organizer = NULL;
char organizer_string[SIZ];
icalproperty *attendee = NULL;
}
wprintf("</TEXTAREA></TD></TR>");
+ /* For a new event, the user creating the event should be the
+ * organizer. Set this field accordingly.
+ */
+ if (icalcomponent_get_first_property(vevent, ICAL_ORGANIZER_PROPERTY)
+ == NULL) {
+ sprintf(organizer_string, "MAILTO:%s", WC->cs_inet_email);
+ memset(&me_as_organizer, 0, sizeof(icalorganizertype));
+ me_as_organizer.value = strdup(organizer_string);
+ icalcomponent_set_organizer(vevent, me_as_organizer);
+ }
+
/* Determine who is the organizer of this event. This is useless
* for now, but we'll need to determine "me" or "not me" soon.
*/
while (prop = icalcomponent_get_first_property(vevent,
ICAL_SUMMARY_PROPERTY), prop != NULL) {
icalcomponent_remove_property(vevent, prop);
+ icalproperty_free(prop);
}
icalcomponent_add_property(vevent,
icalproperty_new_summary(bstr("summary")));
while (prop = icalcomponent_get_first_property(vevent,
ICAL_LOCATION_PROPERTY), prop != NULL) {
icalcomponent_remove_property(vevent, prop);
+ icalproperty_free(prop);
}
icalcomponent_add_property(vevent,
icalproperty_new_location(bstr("location")));
while (prop = icalcomponent_get_first_property(vevent,
ICAL_DESCRIPTION_PROPERTY), prop != NULL) {
icalcomponent_remove_property(vevent, prop);
+ icalproperty_free(prop);
}
icalcomponent_add_property(vevent,
icalproperty_new_description(bstr("description")));
while (prop = icalcomponent_get_first_property(vevent,
ICAL_DTSTART_PROPERTY), prop != NULL) {
icalcomponent_remove_property(vevent, prop);
+ icalproperty_free(prop);
}
if (!strcmp(bstr("alldayevent"), "yes")) {
while (prop = icalcomponent_get_first_property(vevent,
ICAL_DTEND_PROPERTY), prop != NULL) {
icalcomponent_remove_property(vevent, prop);
+ icalproperty_free(prop);
}
while (prop = icalcomponent_get_first_property(vevent,
ICAL_DURATION_PROPERTY), prop != NULL) {
icalcomponent_remove_property(vevent, prop);
+ icalproperty_free(prop);
}
if (all_day_event == 0) {