]> code.citadel.org Git - citadel.git/commitdiff
* VTODO components need to be encapsulated inside VCALENDAR components,
authorArt Cancro <ajc@citadel.org>
Thu, 3 Feb 2005 04:38:41 +0000 (04:38 +0000)
committerArt Cancro <ajc@citadel.org>
Thu, 3 Feb 2005 04:38:41 +0000 (04:38 +0000)
  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.

webcit/ChangeLog
webcit/calendar.c
webcit/webcit.c

index 813fe9d30b22961d87d8e3d1254209f3db77b73a..748feec783b2162fd881ce349378e6c64c0142cc 100644 (file)
@@ -1,4 +1,10 @@
 $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.
@@ -2294,3 +2300,4 @@ Sun Dec  6 19:50:55 EST 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
 
 1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
        * webserver.c: warning fix
+
index a8ed411cd2ec9e1c2face09abb8a423b096d53cf..46e00bdadc99751c59ac873a4a46a3f446a63380 100644 (file)
@@ -604,7 +604,7 @@ void save_individual_task(icalcomponent *supplied_vtodo, long msgnum) {
        char buf[SIZ];
        int delete_existing = 0;
        icalproperty *prop;
-       icalcomponent *vtodo;
+       icalcomponent *vtodo, *encaps;
        int created_new_vtodo = 0;
        int i;
        int sequence = 0;
@@ -699,15 +699,24 @@ void save_individual_task(icalcomponent *supplied_vtodo, long msgnum) {
                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
@@ -716,6 +725,7 @@ void save_individual_task(icalcomponent *supplied_vtodo, long msgnum) {
                         */
                        delete_existing = 1;
                }
+               icalcomponent_free(encaps);
        }
 
        /*
index e9c1fac071457d9e10f80d276089fbbd8ce4cb7d..5e179258d48c75a7888ff280d44dd2a3f830bb2c 100644 (file)
@@ -1028,7 +1028,7 @@ void session_loop(struct httprequest *req)
         */
        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 */