$Log$
+Revision 528.37 2005/02/03 04:38:40 ajc
+* VTODO components need to be encapsulated inside VCALENDAR components,
+ just like we do with VEVENT components. There's a bunch of software
+ (including the beforesave hook on our own Citadel server) that expects
+ this encapsulation.
+
Revision 528.36 2005/02/02 23:25:21 ajc
* Encode GroupDAV uid's using more concise string escaping, because the
old way was making KOrganizer choke.
1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
* webserver.c: warning fix
+
char buf[SIZ];
int delete_existing = 0;
icalproperty *prop;
- icalcomponent *vtodo;
+ icalcomponent *vtodo, *encaps;
int created_new_vtodo = 0;
int i;
int sequence = 0;
icalcomponent_add_property(vtodo,
icalproperty_new_sequence(sequence)
);
-
-
+
+ /*
+ * Encapsulate event into full VCALENDAR component. Clone it first,
+ * for two reasons: one, it's easier to just free the whole thing
+ * when we're done instead of unbundling, but more importantly, we
+ * can't encapsulate something that may already be encapsulated
+ * somewhere else.
+ */
+ lprintf(9, "Encapsulating into full VCALENDAR component\n");
+ encaps = ical_encapsulate_subcomponent(icalcomponent_new_clone(vtodo));
+
/* Serialize it and save it to the message base */
serv_puts("ENT0 1|||4");
serv_gets(buf);
if (buf[0] == '4') {
serv_puts("Content-type: text/calendar");
serv_puts("");
- serv_puts(icalcomponent_as_ical_string(vtodo));
+ serv_puts(icalcomponent_as_ical_string(encaps));
serv_puts("000");
/* Probably not necessary; the server will see the UID
*/
delete_existing = 1;
}
+ icalcomponent_free(encaps);
}
/*
*/
if (!strncasecmp(action, "groupdav", 8)) {
/* do GroupDAV stuff */
- groupdav_main(req, ContentType, ContentLength, content);
+ groupdav_main(req, ContentType, ContentLength, content+body_start);
if (!WC->logged_in) {
WC->killthis = 1; /* If not logged in, don't */
} /* keep the session active */