X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fevent.c;h=1411b5e7cb5913bd2e91123e990e88a664d94c39;hb=3245ec482158b2e402472f7f6de62d04eb571ce4;hp=df2b63a21eef3ae0702c7270cf9233bcb91fb727;hpb=fa9331a6e479ad13f0ee3e89774507acf11e4310;p=citadel.git diff --git a/webcit/event.c b/webcit/event.c index df2b63a21..1411b5e7c 100644 --- a/webcit/event.c +++ b/webcit/event.c @@ -58,6 +58,13 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum) "
\n" ); + wprintf("UID == "); + p = icalcomponent_get_first_property(vevent, ICAL_UID_PROPERTY); + if (p != NULL) { + escputs((char *)icalproperty_get_comment(p)); + } + wprintf(" (FIXME remove this when done)
\n"); + wprintf("
\n"); wprintf("\n", msgnum); @@ -70,7 +77,6 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum) wprintf("\n", bstr("day")); - /* Put it in a borderless table so it lines up nicely */ wprintf("\n"); @@ -83,6 +89,15 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum) } wprintf("\">\n"); + wprintf("\n"); + wprintf("
Location\n" + "
Start\n"); p = icalcomponent_get_first_property(vevent, ICAL_DTSTART_PROPERTY); if (p != NULL) { @@ -162,6 +177,13 @@ void save_individual_event(icalcomponent *supplied_vevent, long msgnum) { 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); + } + 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); @@ -188,6 +210,15 @@ void save_individual_event(icalcomponent *supplied_vevent, long msgnum) { icaltime_from_webform("due") ) ); + + /* Give this event a UID if it doesn't have one. */ + if (icalcomponent_get_first_property(vevent, + ICAL_UID_PROPERTY) == NULL) { + generate_new_uid(buf); + icalcomponent_add_property(vevent, + icalproperty_new_uid(buf) + ); + } /* Serialize it and save it to the message base */ serv_puts("ENT0 1|||4");