$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))"
1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
* webserver.c: warning fix
+
char buf[SIZ];
int i;
int organizer_is_me = 0;
+ int sequence = 0;
now = time(NULL);
strcpy(organizer_string, "");
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("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=007700><TR><TD>"
"<IMG ALIGN=CENTER SRC=\"/static/vcalendar.gif\">"
if (p != NULL) {
escputs((char *)icalproperty_get_comment(p));
}
+ wprintf("<BR>\n");
+ wprintf("SEQUENCE == %d<BR>\n", sequence);
*************************************************************/
wprintf("<FORM NAME=\"EventForm\" METHOD=\"POST\" ACTION=\"/save_event\">\n");
int foundit;
char form_attendees[SIZ];
char organizer_string[SIZ];
+ int sequence = 0;
if (supplied_vevent != NULL) {
vevent = supplied_vevent;
}
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);
);
}
+ /* 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
*/