From: Art Cancro Date: Fri, 20 Dec 2002 04:50:01 +0000 (+0000) Subject: * When saving a calendar event, increment the SEQUENCE property. X-Git-Tag: v7.86~6075 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=f811d91aa35f7458f29115845160a6e354efa760;p=citadel.git * When saving a calendar event, increment the SEQUENCE property. --- diff --git a/webcit/ChangeLog b/webcit/ChangeLog index f36f481d1..299117903 100644 --- a/webcit/ChangeLog +++ b/webcit/ChangeLog @@ -1,4 +1,7 @@ $Log$ +Revision 400.67 2002/12/20 04:50:00 ajc +* When saving a calendar event, increment the SEQUENCE property. + Revision 400.66 2002/12/18 05:03:39 ajc * In the calendar code, changed all "struct tm *" to "struct tm" and changed all "tm = localtime(foo)" to "memcpy(&tm, localtime(foo), sizeof(struct tm))" @@ -1183,3 +1186,4 @@ Sun Dec 6 19:50:55 EST 1998 Art Cancro 1998-12-03 Nathan Bryant * webserver.c: warning fix + diff --git a/webcit/event.c b/webcit/event.c index 0cca6db2a..e54240db2 100644 --- a/webcit/event.c +++ b/webcit/event.c @@ -46,6 +46,7 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum) char buf[SIZ]; int i; int organizer_is_me = 0; + int sequence = 0; now = time(NULL); strcpy(organizer_string, ""); @@ -59,6 +60,13 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum) created_new_vevent = 1; } + /* Learn the sequence */ + p = icalcomponent_get_first_property(vevent, ICAL_SEQUENCE_PROPERTY); + if (p != NULL) { + sequence = icalproperty_get_sequence(p); + } + + /* Begin output */ output_headers(3); wprintf("
" "" @@ -74,6 +82,8 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum) if (p != NULL) { escputs((char *)icalproperty_get_comment(p)); } + wprintf("
\n"); + wprintf("SEQUENCE == %d
\n", sequence); *************************************************************/ wprintf("
\n"); @@ -339,6 +349,7 @@ void save_individual_event(icalcomponent *supplied_vevent, long msgnum) { int foundit; char form_attendees[SIZ]; char organizer_string[SIZ]; + int sequence = 0; if (supplied_vevent != NULL) { vevent = supplied_vevent; @@ -359,7 +370,7 @@ 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); @@ -445,6 +456,19 @@ void save_individual_event(icalcomponent *supplied_vevent, long msgnum) { ); } + /* Increment the sequence ID */ + while (prop = icalcomponent_get_first_property(vevent, + ICAL_SEQUENCE_PROPERTY), (prop != NULL) ) { + i = icalproperty_get_sequence(prop); + if (i > sequence) sequence = i; + icalcomponent_remove_property(vevent, prop); + icalproperty_free(prop); + } + ++sequence; + icalcomponent_add_property(vevent, + icalproperty_new_sequence(sequence) + ); + /* Set the organizer, only if one does not already exist *and* * the form is supplying one */